[R] how to install a package in R on a linux machine?

Scionforbai scionforbai at gmail.com
Thu Feb 22 20:37:58 CET 2007


>> I tried a few times and still couldn't figure out the correct way
>> to install this package.

Help us to help you, Gallon. Which error comes out?

> install.packages("packagename")
> this downloads the package and installs it into the default R package
> library on your machine.

Of course, on a normal installation R need to be run by root to do
this, in order to write in a "system" directory like /usr/lib/.

> If you want to install it to a different
> directory use the 'lib' argument of 'install.packages'.

Again, the user running R must have writing access to the directory
specified by the 'lib' option. This option allows to install R
packages in a directory in your /home, typically.

Maybe you want to try (dependencies=TRUE) to automagically download
and install dependencies.

And of course you downloaded the appropriate package for you R version.



More information about the R-help mailing list