Matrix package fails

I get this error trying to run the metafor package:

> Loading required package: Matrix
Error: package or namespace load failed for ‘Matrix’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Matrix/libs/Matrix.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Matrix/libs/Matrix.so, 0x0006): Library not loaded: @rpath/libgfortran.5.dylib
  Referenced from: <8F5AFB9B-32CA-3DD9-9F39-AAEA21338301> /Library/Frameworks/R.framework/Versions/4.1/Resources/library/Matrix/libs/Matrix.so
  Reason: tried: '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file, not in dyld cache)
Error: package ‘Matrix’ could not be loaded

I do not know what to do to solve it. I am running R version 4.1.2 (2021-11-01) on a Mac computer. Any ideas?

I think you need to install the{Matrix} package.

install.packages("Matrix") 

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.