# Run this as # R --vanilla --args input_file < script.R # infile <- commandArgs(TRUE)[1] outfile <- paste(infile, ".jpg", sep="") data <- read.table(infile, header=T) jpeg(outfile, width = 1000, height = 1000) plot.new() split.screen(c(4,2)) for (i in 1:8) { screen(i) #go through each figure and plot something plot(1:74,data[i,], type = "l", main = rownames(data[i,]), ylab="Error Rate", xlab="Base (1:74)") } close.screen(all=TRUE) dev.off()