我想导出我在ggplot2
.
我试过重新安装svglite
和安装,dependencies = TRUE
但我仍然遇到同样的错误。
我正在使用ggplot2
,reshape
和svglite
:
library(ggplot2)
library(reshape2)
library(svglite)
我生成了一个包含我的图像的变量:
image = ggplot(new.df) + geom_tile(aes(x=algorithm, y=name, fill=solved == "0")) + scale_x_discrete("") +
scale_y_discrete(limits = rev(levels(df$name))) + scale_fill_manual(values = c("#33DD33", "#DD3333"), na.value="gray50") +
theme(axis.text.x = element_text(angle = 90), legend.position="none")
我执行以下行:
ggsave(file='~/Desktop/eterna100_51-100_ordered_TEST.svg', plot=image, device = "svg")
但是,我收到此错误:
Error: package or namespace load failed for ‘svglite’ 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