Cannot load tidyverse after updating R and R Studio

I have just updated my R and R Studio on my Mac running 10.14.6 Mojave. I updated to R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics", and R Studio version 2021.09.2 Build 382 "Ghost Orchid". I copied and pasted my R packages from my previous R version into the folder:

/Library/Frameworks/R.framework/Versions/4.2/Resources/library

Then I checked that my packages were up to date using:

update.packages()

Then I tried to load the tidyverse package:

library(tidyverse)

And I get the error message:

Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/vctrs/libs/vctrs.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.2/Resources/library/vctrs/libs/vctrs.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/4.2/Resources/library/vctrs/libs/vctrs.so
  Reason: image not found

Any help figuring this out would be much appreciated!

After a major version upgrade you need to update your package with checkBuilt = TRUE si you make sure all packages are compiled for the latest R version.

update.packages(checkBuilt = TRUE)

This may not be relevant to your set up at all, but

is the location for the packages in the R System Library. The packages in my R User Library are in

username/Library/R/x86_64/4.2/library

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.