Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k views
in Technique[技术] by (71.8m points)

r - Installing package - cannot open file - permission denied

I'm working in RStudio and am attempting to install the dplyr package. I have installed various other packages without problem but have hit a problem with this.

It seems there are various parts to the install, some of these worked but the problem happens when I get 'the dependency BH'. This is the error:

>Installing package into ‘\xxxxxxxx.local/Desktops/jagnew/My Documents/R/win-library/3.3’
    (as ‘lib’ is unspecified)
    also installing the dependency ‘BH’
    
>trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/BH_1.62.0-1.zip'
    Content type 'application/zip' length 16150075 bytes (15.4 MB)
    downloaded 15.4 MB
    
>trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/dplyr_0.5.0.zip'
    Content type 'application/zip' length 2556205 bytes (2.4 MB)
    downloaded 2.4 MB
    
>Error in install.packages : cannot open file '\xxxxxxx.local/Desktops/jagnew/My Documents/R/win-library/3.3/file142032c9327b/BH/include/boost/function/detail/gen_maybe_include.pl': Permission denied

I have changed the directory/libpath as it did not appear that the file was downloading to the correct folder. file142032c9327b is now in the correct path, but path specified in the error is only correct up to /boost, there is no function folder here..?

I'm not sure if this missing folder is the issue, as the error says 'Permission denied', but it seems odd.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same issue. Tried doing the following and worked for me:

  1. Run the RStudio as administrator
  2. Under the Packages tab, click Install and change Install to Library option to C:/Program...../R/../library and select the desired package to install.

enter image description here

Hope it works.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...