Preface: I have found a similar thread on this topic and ran the steps denoted and it has not fixed the issue, so do not mark as duplicate (also have tried install.packages("gdtools")
).
I'm using RMarkdown to templatize a Word document that requires a nicer looking table than what you can do within regular Markdown and am trying to use flextable
package to do so so.
I can run a sample within an R Script, and get the following:
library(flextable)
ft <- flextable(head(mtcars))
ft <- autofit(ft)
ft
I can run an R code chunk in RMarkdown in RStudio, and get this:
library(flextable)
ft <- flextable(head(mtcars))
ft <- autofit(ft)
ft
When I try to knit
, I get the following error:
Error: package or namespace load failed for 'flextable' in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/gdtools/libs/gdtools.so': dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/gdtools/libs/gdtools.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/gdtools/libs/gdtools.so Reason: image not found Execution halted
How do I get this to Knit into my Word Document?