3

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?

funkfux
  • 283
  • 3
  • 14
  • I find it odd that admin rights are not allowing you to delete something from your home directory, but those look like network paths, not local paths, is that right? That is, does `HOME.COMPANYNAME` map to your local computer or to a file server on your network? Finally, you can always manually remap your libraries using `.libPaths(c("...","..."))` instead of relying on the `R_LIBS` envvar. It isn't ideal, but corporate IT lock-down can be difficult to work around. When you find a `.libPaths` combination that works for you, I suggest you add it to `fila.path(file.expand("~"), ".Rprofile")`. – r2evans Nov 01 '18 at 22:46
  • Sorry should have mentioned that I also tried to set now .libPath on a local path :C// , but still getting the same error after that. (Please see the additions to question above). – funkfux Nov 01 '18 at 23:00
  • What about `.libPaths(c("C:/Users/USERID/Desktop/R/R-3.5.1/library", "\\\\HOME.COMPANYNAME/USERNAME$/Files/R/R-3.5.1/library"))`? You need the rest of the library path in there, not terminating (in this case) with `.../R/`. – r2evans Nov 01 '18 at 23:04
  • Adding those two subfolders lead to the same error and problem, that the first libPath is changed while the second libPaths on the company network still stays: > .libPaths("C:\\Users\\USERID\\Desktop\\R\\R-3.5.1\\library") > .libPaths() [1] "C:/Users/USERID/Desktop/R/R-3.5.1/library" "\\\\HOME.COMPANYNAME/USERNAME$/Files/R/R-3.5.1/library" – funkfux Nov 01 '18 at 23:13
  • Setting the new .libPath on the local folder C:/ allows me to install and load packages but only temporarly within the R Studio-session. 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... – funkfux Nov 01 '18 at 23:37

0 Answers0