2
votes

How to do i resolve the following code error?

library(tidyverse)

Error: package or namespace load failed for ‘tidyverse’:

.onLoad failed in loadNamespace() for 'tidyselect', details:

call: is_string(x)

error: object 'rlang_is_string' not found

In addition: Warning message: package ‘tidyverse’ was built under R version 3.5.3

2
Are you using Windows? If so, this looks suspiciously like a silent installation errorJulian_Hn
I'd start by quitting R (or RStudio), restarting and reinstalling tidyverse.neilfws
Thanks guys. I updated my R to 3.6.0 and reinstalled tidyverse. Seems to work =)EeMei Tang

2 Answers

2
votes

For persistent errors of type, first, ensure you are working with the latest version of R. The installr package is a very convenient way to do this.

Then, start new R session (ideally, not in RStudio).

Uninstall tidyverse, tidyselect, and rlang

    # if you are using multiple libraries, you may need to specify libpath, 
    # using the following: lib="~/R/win-library/3.6"        
    # you can check using the .libPaths() command

    remove.packages("rlang") 
    remove.packages("tidyselect")
    remove.packages("tidyverse")

and, reinstall them one by one with dependencies = TRUE

    install.packages("rlang", dependencies = TRUE)
    install.packages("tidyselect", dependencies = TRUE)
    install.packages("tidyverse", dependencies = TRUE)

That should do it.

0
votes

I also encounter a similar problem like you, which I'm unable to load the tidyverse too. Hope this discuss from the tidyverse github issues maybe relevant to you.

https://github.com/tidyverse/googledrive/issues/275

Here's one of our typical explanations of this. Note that this is not specific to googledrive or rlang. It's an R + Windows gotcha. I suspect for you is rlang (at least). Please note that on Windows, it is very important to quit or restart all R processes before upgrading , because if any R process has loaded, it will keep the .dll file open and the installer will not be able to overwrite .dll. The error message when this happens is very easy to overlook, and the new version will be partially installed: the package description and R code will be updated but the compiled code (in .dll) will not.