Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem installing packages in R "unable to create temporary directory"

Tags:

package

r

rtools

I am having problems installing packages in Rstudio, I tried to install "nortest" among others and it keeps saying the following error:

> install.packages("nortest")
Installing package into ‘C:/Users/meliv/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "C:/Users/meliv/Documents/R/win-library/3.6"' is not writable
probando la URL 
'https://cran.rstudio.com/bin/windows/contrib/3.6/nortest_1.0-4.zip'
Content type 'application/zip' length 39063 bytes (38 KB)
downloaded 38 KB

Warning in install.packages :
cannot create dir 'C:\Users\meliv\Documents\R\win-library\3.6\file408c43245306', reason 'No such file or directory'
Error in install.packages : unable to create temporary directory ‘C:\Users\meliv\Documents\R\win-library\3.6\file408c43245306’

I tried unchecking the folder's "read-only" feature but made no difference.

Hope someone can help me. Thanks

Ps. I have Windows 10

like image 214
Melanie Victoria Adler Avatar asked Oct 15 '25 07:10

Melanie Victoria Adler


1 Answers

Instead of unchecking the folder's "read-only" feature, try checking the "write" permission to the user.

It worked for me. Hope it works for you as well.

[EDIT] Additionally, you can run R as an administrator, that also works.

like image 191
Nevil Avatar answered Oct 17 '25 21:10

Nevil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!