0

我有几个图,我想将它们组合在一起并为组合图添加标题,但不知何故我无法使用 R 组合它们。(使用 RStudio)

  1. plot(resid(lme))结合使用其中 lme 是线性混合模型绘制的两个残差图。
  2. 结合使用绘制的两个交互作用图,interaction.plot(x1,x2,y)其中 x1 和 x2 是两个自变量,y 是因变量。

我试图将绘图存储为变量并使用grid.arrange,但它们不能存储到变量中(只需在绘图区域中生成绘图)。

IE

> int1 <- interaction.plot(data_pos_10$Day,data_pos_10$Drug,data_pos_10$Tumor.Volume,
+                  xlab="Day",ylab="Tumor Volume",main="Interaction Plot Batch 10",
+                  legend=F,
+                  col=c("red","red","green","black","blue"),
+                  lwd=2,
+                  lty=c(1,2,3,4,5))
> int1
NULL
4

1 回答 1

2

在执行绘图代码之前,运行par(mcol=c(2,1))以垂直堆叠或par(mcol=c(1,2))水平堆叠它们。

于 2014-03-10T19:44:40.410 回答