Hi,
all of a sudden I seem unable to load any package in R.
Using library("ggplot2") or tydiverse, dartR and other packages, i get the following error:
library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 1.0.3 is already loaded, but >= 1.0.6 is required In addition: Warning message: package ‘ggplot2’ was built under R version 4.2.2
I have R version 4.2.1 and until yesterday ggplot2 worked perfectly fine there and no loading issues whatsoever.
--> following suggestions on forum i ran this code:
- Remove the
rlang
package via the functionremove.packages()
. - Restart the
R
session (Ctrl + Shift+ F10) and then shut RStudio down completely - Reinstall the
rlang
package via the call:install.packages("rlang", dependencies = TRUE)
But then I got a slightly different error message:
library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘vctrs’ 0.4.1 is already loaded, but >= 0.5.0 is required
I tried to reinstall "vctrs" like this:
install.packages("vctrs", dependencies = TRUE)
Error in install.packages : Updating loaded packages
Restarting R session...
library(vctrs)
packageVersion("vctrs")
[1] ‘0.4.1’
So, I still have the same issue.
I read that they suggest to install new versions of R and RStudio and update all your packages, but 1st that requires a long time and 2nd and most importantly a lot of my code may not work anymore with newer versions of packages as it's often the case, so i want to avoid updating packages especially in such a massive and untargeted way as much as possible.
Any advice on how to solve this issue?
I cannot work on R at all at the moment.
Thanks a lot
Best,
Gabriella