简体   繁体   中英

error install packages in r ‘lib’ is unspecified

I have a problem installing packages in R.

install.packages('rlang')
Installing package into ‘C:/Users/durandeb/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary source needs_compilation
rlang  0.3.4  0.4.7              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB

package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  unable to move temporary installation ‘C:\Users\durandeb\Documents\R\win-library\3.4\file33204d29164f\rlang’ to ‘C:\Users\durandeb\Documents\R\win-library\3.4\rlang’

The downloaded binary packages are in
    C:\Users\durandeb\AppData\Local\Temp\4\RtmpETJiDu\downloaded_packages

the package ends up saving it in a temporary library

How can I assign the default library? It does not allow me to install on any route.

> .libPaths()
[1] "C:/Users/durandeb/Documents/R/win-library/3.4" "C:/Program Files/R/R-3.4.2/library"     

install.packages('rlang',lib = "C:/Users/durandeb/Documents/R/win-library/3.4")

  There is a binary version available but the source version is later:
      binary source needs_compilation
rlang  0.3.4  0.4.7              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/rlang_0.3.4.zip'
Content type 'application/zip' length 1080437 bytes (1.0 MB)
downloaded 1.0 MB

package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  unable to move temporary installation ‘C:\Users\durandeb\Documents\R\win-library\3.4\file332019c556fd\rlang’ to ‘C:\Users\durandeb\Documents\R\win-library\3.4\rlang’

The downloaded binary packages are in
    C:\Users\durandeb\AppData\Local\Temp\4\RtmpETJiDu\downloaded_packages      

Can you help me with a step by step of how to resolve this error? I use Windows 10, I don't have administrator permissions, but I do have write permission for the mentioned folders.

Global configurations file are typical held in the \etc directory(folder) ie C:\Program Files\R\R-4.0.3\etc\Rprofile.site

edit Rprofile.site Under the "# set a site library" section, the default library path is commented out. Uncomment the following line, which has the default path anyway, than if you like to can change something else, just go ahead and do it.

.Library.site <- file.path(chartr("\", "/", R.home()), "site-library")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM