imager package does not work in R 3.6.1

I have upgraded my R to version 3.6.1 and RsStudio to version 1.2.1335. I have no problem in install package imager. However, I get error message when I try to upload imager library in either R or RStudio: library(imager). The error messages are:

Loading required package: magrittr
Error: package or namespace load failed for ‘imager’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/imager/libs/imager.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/imager/libs/imager.so, 6): Library not loaded: /opt/X11/lib/libX11.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/imager/libs/imager.so
  Reason: image not found

Any suggestion to fix it? I am using macOS Mojave Version 10.14.6.

This suggest you might be having problems with X11, do you have tried installing/updating XQuartz in your system?

https://www.xquartz.org/

3 Likes

That is very helpful! After installing XQuartz, I do not get any error message, and it runs perfect!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

Yes, I would like to mark the solution. How to do it? I am new to the Rstudio community.

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