Thursday, August 18, 2011

png figures in a loop in R

This sample script creates 100 png figures with the iteration number included in the name.

for(i in 1:100) {
a<-rnorm(100)
name<-paste("test",i,".png",sep="")
png(name)
plot(a/max(a),type="l")
dev.off()
}

No comments:

Post a Comment