3

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

Phil
  • 7,287
  • 3
  • 36
  • 66

2 Answers2

1

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.

Nevil
  • 11
  • 4
0

Do the below:

  1. Run getwd()
  2. Run .libPaths()
  3. Copy the directory where it says program files.
  4. Run .libPaths(Paste the directory you copied with the quote marks)
  5. Run .libPaths () with no argument.
  6. Try installing your packages