I've come across a few proposed solutions on stackoverflow and in github issues, but I haven't been able to find a solution to the error that I get when installing 'flextable':
Error: package or namespace load failed for ‘flextable’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/username/Library/R/3.6/library/systemfonts/libs/systemfonts.so':
dlopen(/Users/username/Library/R/3.6/library/systemfonts/libs/systemfonts.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
Referenced from: /Users/username/Library/R/3.6/library/systemfonts/libs/systemfonts.so
Reason: Incompatible library version: systemfonts.so requires version 19.0.0 or later, but libfreetype.6.dylib provides version 18.0.0
I noticed that this issue has been raised in the Rstudio community before:
I tried:
reinstalling XQuartz
brew installing cairo and pkg-config
install.packages('zip') and restarting Rstudio
install.packages("gdtools", type = "source"), although this throws an error for me:
ERROR: lazy loading failed for package ‘gdtools’
I can successfully install flextable via install.packages, but it won't load with library().
Have you tried reinstalling systemfonts package? Or installing the development version from GitHub? Since from your error message it seems like you need an updated version of that package.