Unable to update R packages in default library on Windows 7

前端 未结 11 1464
别那么骄傲
别那么骄傲 2020-11-27 04:41

I\'m trying to update packages on RGui (64-bit) using update.packages but I\'m getting the following message:

Warning in install.packages(update         


        
相关标签:
11条回答
  • 2020-11-27 05:15

    I had this exact problem and just changed it for myself. That is I navigated to C:/PROGRAM/R and then right clicked on the R to bring up properties. Went to the Security tab clicked on the Group/User that you want to add permissions for. That for me was USER then clicked EDIT and then selected the boxes that were unchecked to Allow control over. I had to do this specifically for each user (of course I was running the entire time as administrator). Clicked Apply/OK and all is well. I can now update/install/ new libraries and what have you for this computer without having to run R as the admin.

    0 讨论(0)
  • 2020-11-27 05:16

    I had a similar error recently. Running RStudio as an administrator didn't work. And changing the permissions on C:/Programs/R is a bit clumsy, as you'd have to repeat it for every user.

    The solution for me was changing the library path for R as follows

    1. In the R console, type .libPaths(). You'll see something like this,

      "Path/to/user/R/win-library/x.x" "C:/Programs/R/R-x.x.x"

      The two paths exist because you have defined a user-specific lib path during installation. Replace x.x.x with your R version.

    2. Now set the lib path to the Programs directory

      .libPaths = "C:/Programs/R/R-x.x.x"

    Now you can install.packages() or update.packages()!

    0 讨论(0)
  • 2020-11-27 05:17

    Sometimes there may also be a possibility that your Antivirus is blocking the application. Unblock the application if anti virus has blocked it.

    0 讨论(0)
  • 2020-11-27 05:20

    Without more information, my first guess is that you have insufficient permissions to write to the R site library folder. Usually, R would prompt for creation of a user lib folder to install to, but this can be unreliable under Windows Vista/Windows 7.

    Try:

    dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
    

    In the R console. Libraries should now install to /Users/"you"/R/win-library/x.y, for which you have the appropriate permissions.

    0 讨论(0)
  • 2020-11-27 05:23

    Uninstalling from C:\Program Files and re-installing to C:\R worked for me

    [See mdsumner's comment and Windows FAQ found here]

    "...Users of Vista/Windows 7/8/Server 2008/2012 installing for a single user using an account with administrator rights1 should consider installing into a non-system area (such as C:\R)"

    0 讨论(0)
提交回复
热议问题