How to install R packages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to install R packages

Philipova
Dear R-users,
Please tell me how to install R packages. I have downloaded source files
of some packages (*.tar files). I put them in a directory in my computer.
The computer asked me whether to make personal library.
I tried with:
install.packages(pkgs='pastecs', lib='C;/User/doktorant-220/My
Documents/R/win-library/3.3/pastecs_1.3-18.tar',repos=NULL,type="source")

R gives me the following message:
Warning in install.packages(pkgs = "pastecs", lib =
"C:/User/doktorant-220/My Documents/R/win-library/3.3/pastecs_1.3-18.tar",
 :
  'lib = "C:/User/doktorant-220/My
Documents/R/win-library/3.3/pastecs_1.3-18.tar"' is not writable
Warning: invalid package 'pastecs'
Error: ERROR: no packages specified
Warning messages:
1: running command '"C:/PROGRA~1/R/R-33~1.3/bin/i386/R" CMD INSTALL -l
"C:\Users\doktorant-220\Documents\R\win-library\3.3" "pastecs"' had status
1
2: In install.packages(pkgs = "pastecs", lib = "C:/User/doktorant-220/My
Documents/R/win-library/3.3/pastecs_1.3-18.tar",  :
  installation of package ‘pastecs’ had non-zero exit statu

I will be grateful for your help!
Nina

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to install R packages

Roman Luštrik
If the package is on CRAN, you should just do

install.packages("pastecs")

and R will install the package. You can then use it by calling it with

library(pastecs)

This is the preferred way of installing packages for novice users. If this
is insufficient for you, read on.




To compile from source, you will need a bit more tools. It would appear you
are on Windows. You need to install Rtools to be able to compile and
install R packages.

First try installing package devtools

install.packages("devtools")

During the installation, the interface should ask you if you want to
install RTools. Say yes.

Once finished and assuming everything went well, you should be able to
install from local, github... whatever

install_local("c:/users...path/to/file.tar.gz")

or

install_github("cran/pastacs")

Cheers,
Roman

On Thu, Mar 9, 2017 at 3:12 PM, <[hidden email]> wrote:

> Dear R-users,
> Please tell me how to install R packages. I have downloaded source files
> of some packages (*.tar files). I put them in a directory in my computer.
> The computer asked me whether to make personal library.
> I tried with:
> install.packages(pkgs='pastecs', lib='C;/User/doktorant-220/My
> Documents/R/win-library/3.3/pastecs_1.3-18.tar',repos=NULL,type="source")
>
> R gives me the following message:
> Warning in install.packages(pkgs = "pastecs", lib =
> "C:/User/doktorant-220/My Documents/R/win-library/3.3/pastecs_1.3-18.tar",
>  :
>   'lib = "C:/User/doktorant-220/My
> Documents/R/win-library/3.3/pastecs_1.3-18.tar"' is not writable
> Warning: invalid package 'pastecs'
> Error: ERROR: no packages specified
> Warning messages:
> 1: running command '"C:/PROGRA~1/R/R-33~1.3/bin/i386/R" CMD INSTALL -l
> "C:\Users\doktorant-220\Documents\R\win-library\3.3" "pastecs"' had status
> 1
> 2: In install.packages(pkgs = "pastecs", lib = "C:/User/doktorant-220/My
> Documents/R/win-library/3.3/pastecs_1.3-18.tar",  :
>   installation of package ‘pastecs’ had non-zero exit statu
>
> I will be grateful for your help!
> Nina
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo




--
In God we trust, all others bring data.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Loading...