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

Roberto Perdisci roberto.perdisci at gmail.com
Thu Feb 22 23:11:29 CET 2007


Hi,
  try this:

$sudo R CMD INSTALL <downloaded.package.tar.gz>

If you don't use 'sudo' (or do not have privileges to do so), you need
to either become root (with su) or ask the administrator of the
machine you are using to install the package for you

regards,
Roberto


On 2/22/07, Gabor Csardi <csardi at rmki.kfki.hu> wrote:
> 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
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list