我运行了一个循环,我需要在列表中存储一些图。有时它们是不同类型的,因为当我不能计算实际绘图时,我需要插入虚拟绘图。
为什么基图不能存储在列表中?
library(effects)
df=data.frame(response=sample(10,10),predictor=c(1:10))
model0=lm(response~predictor,df)
plot.list=list()
plot.list[[1]]=plot(Effect("predictor",model0))
plot.list[[2]]=plot(predictor~response,df)
plot.list发布于 2016-08-16 23:07:11
尝试存储函数
x <- list()
x[[1]] <- function(){plot(1)}
x[[2]] <- function(){plot(2)}然后
x[[1]]()https://stackoverflow.com/questions/38978257
复制相似问题