【发布时间】:2020-01-22 10:20:30
【问题描述】:
我在将 r-base 图保存到对象时遇到问题。我想将实际上由layout() 函数合并的两个图组成的整个图分配到一个变量中,然后通过ggarrange() 函数将该图与其他图合并。 recordPlot() 函数不起作用,因为我收到错误消息:
## Warning: Package `gridGraphics` is required to handle base-R plots.
## Substituting empty plot.
## Warning: Package `gridGraphics` is required to handle base-R plots.
## Substituting empty plot.
这是我要保存的情节:
layout(matrix(c(1, 2), 2, 1))
hist(X1209_HCC1806_cv$Absorbance)
boxplot(X1209_HCC1806_cv$Absorbance, horizontal = TRUE)
gridGraphics 包是如何工作的?以及如何将我的情节分配给一个变量以便在ggarrange() 中使用它?
【问题讨论】:
-
看看 ggplotify 包。 cran.rstudio.com/web/packages/ggplotify/vignettes/…
-
您需要安装
gridGraphics包。错误消息告诉您当前没有安装此软件包,因此您的代码不起作用。