tidyverse not loading

I recently updated all of my packages and tried loading library(tidyverse) but received the following error:

Error: package or namespace load failed for 'tidyverse' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called 'tidyselect'
Execution halted

I've tried re-installing tidyverse, as well as ggplot2 and dplyr separately, restarted R as well as my computer, re-installed rlang and tidyselect, and all to no change in the error. ggplot2 seems to load fine but dplyr does not and I get a similar error. When I try and load tidyselect I receive this error:

Error: package or namespace load failed for ‘tidyselect’:
 .onLoad failed in loadNamespace() for 'tidyselect', details:
  call: is_string(x)
  error: object 'rlang_is_string' not found
1 Like

Hmm, very strange. What happens if you run library(rlang)?

If that attaches successfully, what do you get back if you run the following? (note the triple colon, as it's a non-exported function)

rlang:::rlang_is_string

Hi Mara!

library(rlang) runs fine, but rlang_is_string does not appear as an option in the option drop down with either two or three semi colons (did not know about the three semi colons!).

Hmm. Can you try installing the development version of rlang from GitHub?

devtools::install_github("r-lib/rlang")

Unfortunately received the same error, also tried loading library(devtools) on it's own and still met with:

Error: package or namespace load failed for ‘devtools’:
 .onLoad failed in loadNamespace() for 'pkgload', details:
  call: is_string(x)
  error: object 'rlang_is_string' not found

This sort of errors is typical of silent installation failures on Windows. On this platform, DLLs can't be copied over if they are already in use. The manifestation of this is a warning (easily overlooked in the installation output) and a broken package.

Please close all your R and RStudio sessions before installing rlang. If you install it from github, use the {remotes} package which doesn't depend on rlang and thus won't load it in your session:

remotes::install_github("r-lib/rlang")

If that still doesn't work, check rlang isn't automatically loaded from your RProfile when you start a session.

3 Likes

Hi Lionel,

I tried using your suggestion and get an error with:

Error: Failed to install 'rlang' from GitHub:
  (converted from warning) incomplete final line found on 'C:\Users\(myusername)\Documents\.Rprofile'

I tried accessing my .Rprofile with usethis::edit_r_profile() but then was met with:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘rlang’

The good news is I was able to correct everything by re-installing usethis and rlang but when this popped up:

image

Specifically hitting "No" instead of "Yes" (which I normally default to) corrected the issue and now everything works fine. The bad news is I don't know why this worked. I would love to understand why this happened if anyone has insight for future users?

I have suppress folders named
image
and rlang folder in package folder (C:\Users\hp\Documents\R\win-library\3.6)
before re-installing rlang package

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.