I have a few R packages installed under ~/R/i486-pc-linux-gnu-library/2.11
.
I would like to make them, and any other R package I install from now on, available to all R users. I don't mind re-installing the packages I already have in a neutral place (they are just a few). So how do I do that?
Remember in R, Boolean (TRUE and FALSE) must be all capital letters or R will not recognize them as Boolean. At the top, got to Tools and select Install Packages from the drop down. Finally, make sure install dependencies and checked and click install.
Solution 2: Use RStudioChanging the configuration in R Studio to solve install packages issue. Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”. For other RStudio issues refer to official Troubleshooting Guide here.
You only need to install packages the first time you use R (or after updating to a new version). **R Tip:** You can just type this into the command line of R to install each package. Once a package is installed, you don't have to install it again while using the version of R!
You can install multiple packages by passing a vector of package names to the function, for example, install. packages(c("dplyr", "stringr")) . That function will install the requested packages, along with any of their non-optional dependencies.
aL3xa gives (IMHO) bad advice. Do not mess with /usr
which is handled by the package management system. Instead, use the facility provided by /usr/local/lib/R/site-library
.
That latter directory is already searched by default. All you need to do is to add yourself to group staff
as that group has write-rights there -- try adduser yourid staff
where yourid
is your user name on the system. Afterwards you should be able to install there without problems.
Another thing you may like on Ubuntu is apt-get install littler
and then use the install.r
and upgrade.r
helper scripts from the examples directory. I use them all the time.
aL3xa answer is wrong; you shouldn't expose those directories to write for all users.
Run R as a root (probably using sudo R
) and then install packages as usual -- they will be placed in a global library and will be available for all users.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With