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

Gabor Csardi csardi at rmki.kfki.hu
Thu Feb 22 11:40:54 CET 2007


The easiest is perhaps to do 

install.packages("packagename")

this downloads the package and installs it into the default R package
library on your machine. If you want to install it to a different 
directory use the 'lib' argument of 'install.packages'.

If you don't want to download the package again but want to use the 
downloaded one, use the following command:

install.packages(repos=NULL, pkgs="the.file.you've.downloaded")

You can also install R packages from the command line, like this:

R CMD INSTALL -l <lib.directectory> <downloaded.package.file>

Gabor

On Thu, Feb 22, 2007 at 04:44:25PM +0800, gallon li wrote:
> I downloaded the tar.gz file from r-project website (and saved it in a local
> directory) and wish to use the package in R.
> 
> But I am not sure how to use the install.packages command. I tried a few
> times and still couldn't figure out the correct way to install this package.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    MTA RMKI, ELTE TTK



More information about the R-help mailing list