Search code examples
rdropbox

Unable to install R packages


Most times when I attempt to install an R package, I'll get the following error message. The error message I got below occurred when I tried to install a package named "moments". The package was found, downloaded and unpacked but I don't understand why it couldn't be installed. The destination folder does exist. It is not my R working directory though, if that matters.

package ‘moments’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  unable to move temporary installation ‘C:\Users\fs103799\Dropbox\R3.3.1\library\file1da0c1d9622a1\moments’ to ‘C:\Users\fs103799\Dropbox\R3.3.1\library\moments’

The downloaded binary packages are in
    C:\Users\fs103799\AppData\Local\Temp\Rtmp6ZSV46\downloaded_packages

Solution

  • I am getting the same issue when installing into Dropbox folder while Dropbox is running, exit Dropbox then try to install, it should work.

    install.packages("moments", lib = "C:/xxx/Dropbox/")
    

    I have admin rights on the computer.

    R version 3.3.0 (2016-05-03)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows 7 x64 (build 7601) Service Pack 1