Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R package updates

Tags:

r

rlang

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:\Users\tomsp\AppData\Local\Temp\RtmpmooXKa\downloaded_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?

like image 494
tom Avatar asked Dec 10 '22 04:12

tom


2 Answers

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.

like image 177
Hong Ooi Avatar answered Dec 28 '22 23:12

Hong Ooi


For any reason, at least in Windows, some R processes may still be running in background. Close your current R session, kill all processes related to R and try again.

like image 30
Sébastien Wieckowski Avatar answered Dec 28 '22 23:12

Sébastien Wieckowski