[R] Can't get installing a package source (.tar.gz) from a web page to work...

Søren Højsgaard Soren.Hojsgaard at agrsci.dk
Thu Sep 15 10:34:39 CEST 2011


I have created an R-package with datasets which I want my students to install (the package is not on CRAN). 

1) I've put the package on the web in a directory called 'data' and I thought I could do:

> install.packages("http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/LiSciData_0.0-03.tar.gz",repos=NULL,type="source")

Warning: invalid package 'http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/LiSciData_0.0-03.tar.gz'
Error: ERROR: no packages specified
Warning messages:
1: running command 'C:/programs/R/current/bin/i386/R CMD INSTALL -l "C:/programs/R/current/library"   "http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/LiSciData_0.0-03.tar.gz"' had status 1 
2: In install.packages("http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/LiSciData_0.0-03.tar.gz",  :
  installation of package 'http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/LiSciData_0.0-03.tar.gz' had non-zero exit status

2) I've then put the package in data/src/contrib/ and try:

> install.packages('LiSciData_0.0-03.tar.gz',repos='http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/', type='source')
Warning: unable to access index for repository http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘LiSciData_0.0-03.tar.gz’ is not available (for R version 2.13.1)

3) If I put the package in the Rs working directory then the following works:
> install.packages("LiSciData_0.0-03.tar.gz",repos=NULL,type="source")

I would much prefer if it could be done directly from the web in the spirit of attempt 1) above (because then fewer things can go wrong for the students). Any hint on what I am doing wrong? sessionInfo() shown below.

Regards
Søren



> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Danish_Denmark.1252  LC_CTYPE=Danish_Denmark.1252    LC_MONETARY=Danish_Denmark.1252 LC_NUMERIC=C                    LC_TIME=Danish_Denmark.1252    
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] SHDtools_1.0
loaded via a namespace (and not attached):
[1] tools_2.13.1


More information about the R-help mailing list