Unable to update R packages in default library on Windows 7

前端 未结 11 1668
别那么骄傲
别那么骄傲 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: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()!

提交回复
热议问题