我想通过将跨度参数更改为更平滑的黄土来制作单面图(格子样式)。我尝试使用如下的 for 循环,但没有生成绘图。如果我要使用 ggsave 函数,这些图将单独保存。
另外,我想知道是否有更简洁的方法来完成这样的任务?
x <- rep(1:10,4)
y <- 1.2*x + rnorm(40,0,3)
s <- seq(0.2,0.8,0.1)
# plot the series of plots by varying the span parameter
for (s_i in s) {
qplot(x, y, geom = 'c('point','smooth'), span = s_i)
}