b <- ggplot(cars,aes(x=speed,y=dist))+geom_line()
grid.arrange(
b,
plot(cars),
ncol=1
)
出现以下错误
Error in gList(list(grobs = list(list(x = 0.5, y = 0.5, width = 1, height = 1, : 只有 "grobs" 允许在 "gList" 中。
假设我的第二个图必须从 plot
函数中输出。如何将该输出转换为类似于 grob
的对象,以便与 grid.arrange
协同工作?