After trying to bump this so the topic does not close (which is annoying that a topic can close in a few weeks just because there haven't yet been replies), an Rstudio Sustainer messaged me suggesting that I restart the R session and re-installing tidyverse.
After doing the following:
-updating to the latest stable version of R (4.1.2)
-updating to the latest stable version of Rstudio (2021.09.2+382)
-updating tidyverse
and all dependencies
I still get errors when trying to load tidyverse packages. I do not get these errors when loading them in base R--I only get them when running Rstudio. I also don't get the error when restarting the R session in Rstudio. I only get the error in the initial R session load of Rstudio. Is there a way so I don't have to restart the R session every time I load Rstudio?
Here are some of the large variety of errors I've received:
> library(tidyverse)
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
Error: package or namespace load failed for ‘tidyverse’:
.onLoad failed in loadNamespace() for 'dplyr', details:
call: options()
error: Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'NULL'
> library(tidyverse)
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
Error: package or namespace load failed for ‘tidyverse’ in is(f, "groupGenericFunction"):
object 'class2' not found
> library("tibble")
Error: package or namespace load failed for ‘tibble’ in get(name, envir = table):
argument to 'findVarLoc' is not an environment
> library("tidyverse")
Warning: stack imbalance in 'Recall', 32 then 33
Error: package or namespace load failed for ‘tidyverse’ in is(fdef, "genericFunction"):
object 'class1Def' not found
Error: package or namespace load failed for ‘tidyverse’ in as.environment(where):
no item called "methods" on the search list
invalid option "error"
> library("tidyverse")
*** recursive gc invocation
*** recursive gc invocation
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: NULL
error: invalid version specification ‘NULL
> library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in .getClassesFromCache(Class):
class should be either a character-string name or a class definition
> library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in (function (hash = TRUE, parent = parent.frame(), size = 29L) :
use of NULL environment is defunct
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in whichMethodMetaNames(impvars):
object 'impvars' not found
Here are my package versions:
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
system code page: 65001
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4 readr_2.1.1 tidyr_1.1.4 tibble_3.1.6
[8] ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.8 cellranger_1.1.0 pillar_1.6.5 compiler_4.1.2 dbplyr_2.1.1 tools_4.1.2
[7] jsonlite_1.7.3 lubridate_1.8.0 lifecycle_1.0.1 gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.12
[13] reprex_2.0.1 cli_3.1.1 rstudioapi_0.13 DBI_1.1.2 haven_2.4.3 xml2_1.3.3
[19] withr_2.4.3 httr_1.4.2 fs_1.5.2 generics_0.1.1 vctrs_0.3.8 hms_1.1.1
[25] grid_4.1.2 tidyselect_1.1.1 glue_1.6.0 R6_2.5.1 fansi_1.0.2 readxl_1.3.1
[31] tzdb_0.2.0 modelr_0.1.8 magrittr_2.0.1 backports_1.4.1 scales_1.1.1 ellipsis_0.3.2
[37] rvest_1.0.2 assertthat_0.2.1 colorspace_2.0-2 utf8_1.2.2 stringi_1.7.6 munsell_0.5.0
[43] broom_0.7.11 crayon_1.4.2
I'm using RStudio 2021.09.2+382 "Ghost Orchid" Release (fc9e217980ee9320126e33cdf334d4f4e105dc4f, 2022-01-04) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36