I\'m using R to loop through a data frame, perform a calculation and to make a plot.
for(i in 2 : 15){
# get data
dataframe[,i]
# do analysis
# make plot
Have a look at the packages lattice or ggplot2, the plot functions in these packages create objects which can be assigned to variables and can be printed or plotted at a later stage.
For instance with lattice:
library("lattice")
i <- 1
assign(sprintf("a%d", i), xyplot(1:10 ~ 1:10))
print(a1) # you have to "print" or "plot" the objects explicitly
Or append the objects to a list:
p <- list()
p[[1]] <- xyplot(...)
p[[2]] <- xyplot(...)