R Error when installing/loading packages from library on company pc

Viewed 580

After opening R Studio the following Error-message appears: This error also always appears in the end when I am trying to install or load packages:

Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
  no package 'knitr' was found

Some maybe helpful facts:

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1  

I am working on a company laptop without admin-rights, why I have set my library path manually to the following writable folders:

> .libPaths()
[1] "\\\\HOME.COMPANYNAME/USERNAME$/Files/R/win-library/3.5"
[2] "\\\\HOME.COMPANYNAME/USERNAME$/Files/R/R-3.5.1/library"

The second .libPath() was created automatically some weeks after the first. I cannot manually delete both .libPaths from my laptop due to missing admin-rights.

I also tried to remove the libraries as recommended in several posts with:

R_LIBS=C:/Program Files/R/R-2.15.2/library

Nevertheless, the .libPaths stayed the same after this:

> .libPaths()
[1] "\\\\HOME.COMPANYNAME/USERNAME$/Files/R/win-library/3.5"
[2] "\\\\HOME.COMPANYNAME/USERNAME$/Files/R/R-3.5.1/library"

I also tried setting a new .libPath on a local folder C:// :

.libPaths("C:\\Users\\USERID\\Desktop\\R")

After that, the first .libPath is replaced by the new local one, while the second .libPath stays the same and I am getting the same error again:

> .libPaths()
[1] "C:/Users/USERID/Desktop/R"                                              
"\\\\HOME.COMPANYNAME/USERNAME$/Files/R/R-3.5.1/library"

Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
  no package 'knitr' was found

Setting the new .libPath on the local folder C:/ allows me to install and load packages but only temporarly within the R Studio-session:

> install.packages("FDboost")
Installing package into ‘C:/Users/USERID/Desktop/R/R-3.5.1/library’
(as ‘lib’ is unspecified)

After quitting and restarting the R session, the newly defined .libPath on C:/ as well as the installed packages are deleted.

Maybe I have to add the .libPath to the filepath as recommended by @r2evans so that it is saved also after quitting the R session? I did not figure out how to do so...

For the last months, I was able to install and load packages from these two library paths, maybe there was an antivirus update that now makes problems? I did not change any settings but it seems like R cannot find or edit the installed packages anymore. Deinstalling R or RStudio is not a possible solution, since I need admin rights to reinstall them.

Since other posts did not bring the solution so far, maybe anybody has more ideas?

0 Answers
Related