Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
694 views
in Technique[技术] by (71.8m points)

rlang - R package updates

I have been having some issues accessing an updated version of a package in R.

On running a workflow for data analysis I got this error message:

library(dplyr) Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 0.2.1 is already loaded, but >= 0.2.2 is required

I therefore tried to update both the "dplyr" and "rlang" packages.

On updating I get the messages:

Installing package into ‘C:/Users/tomsp/OneDrive/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this session --- trying URL 'https://cran.ma.imperial.ac.uk/bin/windows/contrib/3.5/rlang_0.2.2.zip' Content type 'application/zip' length 820944 bytes (801 KB) downloaded 801 KB

package ‘rlang’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘rlang’

The downloaded binary packages are in C:UsersomspAppDataLocalTempRtmpmooXKadownloaded_packages

However if I check the package using the code below it still has version 0.2.1

packageVersion("rlang") [1] ‘0.2.1’

I checked my library paths and still have not managed to be run the latest version(0.2.2) of the package rlang.

Any advice of what I am doing wrong or how I can solve this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Restart R and run install.packages again. On Windows, you can't update a package that's already loaded, if the package contains compiled C/C++/Fortran code. This includes dplyr and rlang.

To be doubly sure, before you run install.packages, go to your R packages directory (C:/Users/tomsp/OneDrive/Documents/R/win-library/3.5) and delete any zero-length files that are present. These are artifacts of failed install attempts and will break install.packages if present.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...