Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
r基图赋值_R_Ggplot2_Plot_Graphics - Fatal编程技术网

r基图赋值

r基图赋值,r,ggplot2,plot,graphics,R,Ggplot2,Plot,Graphics,我在将r基绘图保存到对象时遇到问题。我想将整个绘图分配给一个变量,该变量实际上由layout()函数合并的两个绘图组成,然后通过ggarrange()函数将此绘图与其他绘图合并。recordPlot()函数不起作用,因为我收到一个错误: ## Warning: Package `gridGraphics` is required to handle base-R plots. ## Substituting empty plot. ## Warning: Package `gridGraphi

我在将r基绘图保存到对象时遇到问题。我想将整个绘图分配给一个变量,该变量实际上由
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()
中使用它?

完全正确。您只需使用
install.packages(“gridGraphics”)
安装
gridGraphics
。您的代码非常适合我。

请查看ggplotify软件包。您需要安装
gridGraphics
软件包。错误消息告诉您当前没有安装此软件包,因此代码无法工作。