【发布时间】:2016-02-11 09:52:17
【问题描述】:
我创建了多个保存在列表中的图。 现在我想保存它们并保留它们在列表中的名称。 到目前为止,我的代码如下。
pdfplots <- function(PlotList){
L <- List()
for (i in 1:length(L)){
names(L[[i]]) <- paste0(names(PlotList), i)
pdfPath <- (file = "~/Documents/MyFile/MyPlots, names(L[[i]])")
myplot <- boxplot(PlotList[[i]])
}
dev.off()
}
因此,我想获得一个保存在特定路径上的 pdf 图。 任何帮助将不胜感激
【问题讨论】:
-
1.在
pdfPath行中,引号位于错误的位置。 2. 缺少pdf()命令。 3. 使用lapply循环列表。