haven package is not loading

I've been working on my R code for several days and everything has worked flawlessly. But suddenly I can no longer open the haven package.

As soon as I enter “library(haven)", the following error appears:

Error: package or namespace load failed for ‘haven’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/haven/libs/haven.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/haven/libs/haven.so, 0x0006): Symbol not found: _iconv
Referenced from: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/haven/libs/haven.so
Expected in: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib
In addition: Warning message:
package ‘haven’ was built under R version 4.3.3

I have already reinstalled R and R Studio and tried it on another device, but the error persists.

Thanks for any help.

The package has a broken installation. Reinstalling R or RStudio won't help with this. Try reinstalling the haven package from source:

install.packages("haven", type = "source")
1 Like

This topic was automatically closed 90 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.