Microsft windows cannot install packages and create dir

Version:1.0 StartHTML:0000000107 EndHTML:0000001414 StartFragment:0000000127 EndFragment:0000001396

Hi all,

I have tried to install packages but I got the problem shows like this;

https://cran.rstudio.com/bin/windows/Rtools/ 
Warning in install.packages : 'lib = "C:/Program Files/R/R-3.6.1/library"' is not writable 
Warning in install.packages : cannot create dir 'C:\Users\khong\OneDrive\??????', reason 'Invalid argument' 
Error in install.packages : unable to create ‘C:/Users/khong/OneDrive/??????/R/win-library/3.6

Please give me the solution.

Best regards,

Tibet

Hi Tibet welcome!

It seems like you have non-ASCII characters in your user library path, R has problems with that. Try running RStudio as administrator so you can install to this path C:/Program Files/R/R-3.6.1/library

Thank you Andresrcs for your suggestion, I will try to fix this

Hi

I did it as suggested, but the problem still remain.

Regards

What error message do you get if you run this command on RStudio running as administrator?

# You can try with any other package you want
install.packages("dplyr", lib = "C:/Program Files/R/R-3.6.1/library")

Hi Andreasrcs, the error shows like this:

Version:1.0 StartHTML:0000000107 EndHTML:0000003424 StartFragment:0000000127 EndFragment:0000003406

https://cran.rstudio.com/bin/windows/Rtools/ 
Warning in install.packages : 'lib = "C:/Program Files/R/R-3.6.1/library"' is not writable 
Error in install.packages : unable to install packages 
> install.packages("ithir") 
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: https://cran.rstudio.com/bin/windows/Rtools/ 
Warning in install.packages : 'lib = "C:/Program Files/R/R-3.6.1/library"' is not writable 
Error in install.packages : unable to install packages

>

This suggests you are not running RStudio as administrator, otherwise you would have write permissions for that folder, does your user has administrative rights?

Also you need to install Rtools if you want to install packages from source on windows systems, you can download it from here

https://cran.r-project.org/bin/windows/Rtools/

Hi Andresrcs,

Thank you for your help, I just got it as I have install Rtools and run Rstudio as administrator.

Best regards,

Tibet

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.