Warning in install.packages: unable to move temporary installation

后端 未结 11 2460
孤城傲影
孤城傲影 2020-12-05 05:00

I\'ve found a number of questions related to this warning when installing or updating packages in R/RStudio, but none seem to completely match my situation:

  • Co
11条回答
  •  借酒劲吻你
    2020-12-05 05:22

    Got the same error - seems to be a company gp / access security problem.

    It might also be worthwhile checking whether the folder it fails to write to has a Read Only structure (Right Click - Properties). This folder's address can be found by running: .libPaths()[1] in R.

    An ad hoc solution to this problem is to unzip and store the downloaded (but not moved) packages using a piece of R code below. You will get an error stating where the binary packages are located (something like: C:/Users/....AppData/...)

    Now you can simply unzip the files from here to your .libPaths() location

    zipF <- list.files("C:/Users//AppData/Local/Temp/Rtmp4Apz6Z/downloaded_packages", full.names = TRUE)
    outDir <- .libPaths()[1]
    
    for(i in 1: length(zipF)) {
    unzip(zipF[i],exdir=outDir)
    }
    

    A more general solution will still be extremely worthwhile, as this is unfortunately a common problem when updating R on Windows.

提交回复
热议问题