Make a file writable in order to add new packages

不打扰是莪最后的温柔 提交于 2019-12-17 14:48:22

问题


I use Rstudio and try to add new packages through command console.

It fails to install it for this reason

install.packages("devtools"); devtools::install_github("hadley/rvest")
Warning in install.packages :
  'lib = "C:/Program Files/R/R-3.2.1/library"' is not writable
Warning in install.packages :
  cannot create dir 'C:\Users\myuser', reason 'Permission denied'
Error in install.packages : unable to create ‘C:/Users/myuser/Documents/R/win-library/3.2’
Error in loadNamespace(name) : there is no package called ‘devtools’

How can I make this file writable?


回答1:


Changing the security setting on the R folder to "full control" fixed this for me. See the third posting down at this link for step by step instructions: Unable to update R packages in default library on Windows 7




回答2:


Just run RStudio as an administrator. Right-Click on it and choose run as Administrator




回答3:


I ran into this problem. The issue for me was using single quotes instead of double quotes. Using install.packages("foo") worked fine, whereas install.packages('foo') caused this issue.




回答4:


As i have found out that disabling the Ransomware protection on Window Defender allows me to write in the directory.

This solved the problem. Hope it works for you.



来源:https://stackoverflow.com/questions/31018358/make-a-file-writable-in-order-to-add-new-packages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!