To save multiple graphics, e.g, Rplot001.pdf, Rplot002.pdf, …, Rplot050.pdf, we don’t have to call pdf() 50 times (or another graphics device function) in R. Instead, use Rplot%03d.pdf for the filename argument in pdf() and each plot() call will be saved to a new pdf file. Run dev.off() once at the end to close all devices!… Read more »