Whenever I try to install a package using devtools:install_github()
in RStudio, I always get the following error
Error: ERROR: no permission to install to directory.....
Example: I tried installing abbrevTexts package from github because it isn't on CRAN
devtools::install_github(repo = 'GitHub - edvardoss/abbrevTexts: Functions that will make life less sad when working with abbreviated text for multiclassification tasks')
install_github(repo = 'https://github.com/edvardoss/abbrevTexts')
Downloading GitHub repo edvardoss/abbrevTexts@HEAD
v checking for file
'C:\Users\Admin\AppData\Local\Temp\RtmpaYzhG4\remotes13087fd31b53\edvardoss-abbrevTexts-e1ced05/DESCRIPTION' (1.4s)
- preparing 'abbrevTexts': (458ms)
v checking DESCRIPTION meta-information
- checking for LF line-endings in source and make files and shell scripts (534ms)
- checking for empty or unneeded directories
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in
serialize/load version 3 cannot be read in older versions of R.
File(s) containing such objects:
'abbrevTexts/data/rawProducts.RData'
'abbrevTexts/data/standardProducts.RData'
- building 'abbrevTexts_0.1.0.tar.gz'
Installing package into ‘C:/Users/Admin/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
Error: ERROR: no permission to install to directory 'C:/Users/Admin/Documents/R/win-library/4.1'
Warning message:
In i.p(...) :
installation of package ‘C:/Users/Admin/AppData/Local/Temp/RtmpaYzhG4/file13082b9f66da/abbrevTexts_0.1.0.tar.gz’ had non-zero exit status
I have tried updating permissions on every R folders but to no avail. I can install packages from CRAN using install.packages()
easily and without problems
My .libPaths()
shows 2 directories.
[1] "C:/Users/Admin/Documents/R/win-library/4.1"
[2] "C:/Program Files/R/R-4.1.0/library"
The first directory contains my packages. Please I need to know if this is an R problem or Windows permission issue and how best to fix it. This issue is really affecting my productivity. Help is really needed.
- R version 4.1.0
- RStudio version 2022.02.3 Build 492
- HP Windows 10