files = commandArgs(trailingOnly=TRUE); if (length(files) < 2) { quit(); } png(files[1]); par(mfcol=(2, ceiling((length(files)-1)/2))); for (f in files[2:length(files)) { x = read.table(f, sep="\t")[[2]]; hist(x); }