我正在尝试在内存中捕获ggplot2图形创建的结果,以便将其发送到服务器。有没有好的想法来解决这个问题?
我的代码目前看起来像这样:
我的代码目前看起来像这样:
data(mtcars)
x <- ggplot(mtcars, aes(x=mpg, y=hp)) +
geom_point(shape=1)
print(x) # RStudio can capture the output, but I'm unable to do it.
ggsave(filename="a.jpg", plot=x) # not really a solution, need it not on disk, but as blob in memory.
BLOB
类型——例如在此博客文章中所示。 - nrussell