Cannot install R packages from source on Windows

1.1k Views Asked by At

I had to reinstall R and Rstudio on my laptop, and since then I am not able to install packages from source.

I checked the installation of rtools, and I think it should have worked.

> Sys.which("make")
                              make 
"C:\\rtools40\\usr\\bin\\make.exe" 

Whenever I try to install a package, it fails and I always get the same error:

> install.packages("jsonlite", type = "source")
Installing package into ‘C:/Users/Teresa/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/jsonlite_1.8.0.tar.gz'
Content type 'application/x-gzip' length 1051625 bytes (1.0 MB)
downloaded 1.0 MB

"&" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
Warning in install.packages :
  installation of package ‘jsonlite’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Teresa\AppData\Local\Temp\Rtmpe2X2PM\downloaded_packages’

This is my sessionInfo():

R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

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

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

loaded via a namespace (and not attached):
[1] compiler_4.1.3 tools_4.1.3  

How can I solve this?

0

There are 0 best solutions below