I am getting this error upon running the following code and do not know how to fix it. I have svglite
installed but when I run library(svglite)
I get the same error:
Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/gdtools/libs/gdtools.so': dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/gdtools/libs/gdtools.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/gdtools/libs/gdtools.so Reason: image not found
x = c(1,2,3,4)
y = c(1,2,3,4)
p <- ggplot(data = data.frame(x=x,y=y), aes(x = x, y = y)) +
geom_line() +
ggsave(filename = "ROC_plot_6x4.svg", plot = p, device = "svg",
width = 6, height = 4, units = "in")
library(svglite)