I recently have troubles loading new packages that I have installed. For example: I installed the package haven, but when using the library(haven) command I always get the following message:
library(haven)
Fehler: Laden von Paket oder Namensraum für ‘haven’ in dyn.load(file, DLLpath = DLLpath, ...): fehlgeschlagen
kann shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/vctrs/libs/vctrs.so' nicht laden:
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
Here is what I already tried:
deinstall and install R and R studio
install package via this command install.packages("haven", type="binary")
The installed package vctrs seems to have been compiled against R 4.0 but installed with R 4.2. That is why it cannot load /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib.
I would try and reinstall at least vctrs as before and see if that works. haven or the RStudio version is definitely not the real problem.
PS: I am on M1 Mac and juts upgraded Rstudio and added R 4.2.0 and everything seems to work when installing haven.
I ran the following:
install.packages("vctrs")
library(vctrs)
My output however again shows an error after loafing the package:
library(vctrs)
Fehler: Laden von Paket oder Namensraum für ‘vctrs’ in get(Info[i, 1], envir = env): fehlgeschlagen
lazy-load database '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/vctrs/R/vctrs.rdb' is corrupt
Zusätzlich: Warnmeldung:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
Make sure that Folder /Library/Frameworks/R.framework/Versions/4.2/ (and /Library/Frameworks/R.framework/Versions/4.0/ if you uninstalled R 4.0) is completely empty (any files left after 4.2/4.0 uninstall, please delete`