With a fresh download of R and Rstudio onto a new computer I have been unable to download any packages. For context this laptop is a managed device so this could be causing issues. The location of the R library is as specified by .libPaths.
.libPaths()
[1] "C:/Users/guq25nyu/AppData/Local/R/R-4.4.3/library"
install.packages("rlang")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Content type 'application/zip' length 1626730 bytes (1.6 MB)
downloaded 1.6 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\guq25nyu\AppData\Local\Temp\RtmpWWZdSv\downloaded_packages
library("rlang")
Error: package or namespace load failed for ‘rlang’:
.onLoad failed in loadNamespace() for 'rlang', details:
call: NULL
error: The rlang package is not properly installed.
The DLL version does not correspond to the package version.
Please update rlang to the latest version.
Updating packages on Windows requires precautions:
https://github.com/jennybc/what-they-forgot/issues/62
However as you can see the package is downloaded into a different folder. Despite many attempts to force Rstudio to download packages into the correct folder it always forces the files into this folder but then it won't load them using library from that folder. I have also tried to solve this error by deleting all copies of Rlang on the computer, installing and updating Rlang, reinstalling R and Rstudio, and nothing has worked
Any help would be really appreciated because I have spent many days on this and have failed to find a solution.