1

My Institution doesn't give me internet access on the computer I'm running R on. So I have to download packages with all dependencies on one PC and then install them from source on my work PC.

Downloading packages with dependencies worked fine using this solution However, installing them with (e.g. for lavaan):

install.packages(pkgs = "lavaan_0.5-20.tar.gz", repos = NULL, type = "source")

produces several warnings:

Warnung: ungültiges Paket 'lavaan_0.5-20.tar.gz'
Fehler: Fehler: keine Pakete angegeben
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\HIP\Documents\R\win-library\3.3" "lavaan_0.5-20.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘lavaan_0.5-20.tar.gz’ had non-zero exit status

I also tried this solution and used

library(tools)
write_PACKAGES("C:/Users/HIP/Documents/R/R_packages")

then deleted the PACKAGES.gz (as suggested in a comment) and used

install.packages(pkgs="lavaan", type="source", 
contriburl="file:///C:/Users/HIP/Documents/R/R_packages") 

and it gave me the following warnings:

Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib:
  cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  InternetOpenUrl failed: 'Der Servername oder die Serveradresse konnte nicht verarbeitet werden.'
Warning in install.packages :
  unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'
Installing package into ‘C:/Users/HIP/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘lavaan’ is not available (for R version 3.3.0)

Does anybody have an idea what might be the problem? Your help would be much appreciated!

Thank you!

Community
  • 1
  • 1
Simone
  • 21
  • 2

1 Answers1

1

On linux mint I solved the problem by writing the whole path (starting with /home/...) to the tar.gz-file. If the working directory is the directory with the tar.gz-file, this can be achieved by

install.packages(pkgs= paste(getwd(),"/lavaan_0.5-20.tar.gz",sep=""), repos = NULL, type ="source")
Martin Gal
  • 16,640
  • 5
  • 21
  • 39