I want to make multiple barplots by using a for loop, and save the plots as seperate .bmp files.
I start from a list of data frames (covpatient). I know how to make a single barplot, but I don’t know how to put them in a for loop & save the results.
for (i in 1:length(covpatient)) {
filename = paste(covpatient[[1]]$gene[1],"bmp", sep = ".")
barplot ... OK
print(?)
dev.off()
}
Could someone give me a hand?
You are almost there: