Dear R family,i am trying to plot and save, simultaneously, about 1000. the name of each plot is contained in "names" file. when i run this loop, i get an error. "Error in plot.new() : Unable to open file 'C:/R/SAVEHERE/myplot_Tak.jpg' for writing". could you please correct the mistake in the loop? >names<-(names(sp)) >for(a in seq_along(names)){ >mypath <- file.path("C:","R","SAVEHERE",paste("myplot_", names[a], ".jpg",sep >= "")) >jpeg(file=mypath) >for (i in seq(1)){ >b<-lapply(res,function(x) {if(is.data.frame(x[,-1])) rowMeans(x[,-1]) else >mean(x[,-1])}) >lapply(seq_along(res), fun) >fun <- function(i){ >matplot(res[[i]][,-1], type="l",col="grey") >lines(b[[i]], lwd = 2, col = "black") >}} >dev.off() >}
thanks in advance eliza [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.