I know that
pdf("myOut.pdf")
will print to a PDF in R. What if I want to
Make a loop that prints subsequent graphs on new pages of a PDF file (appending to the end)?
Make a loop that prints subsequent graphs to new PDF files (one graph per file)?
Not sure I understand.
Appending to same file (one plot per page):
New file for each loop:
Did you look at help(pdf) ?
For 1), you keep onefile at the default value of TRUE. Several plots go into the same file.
For 2), you set onefile to FALSE and choose a filename with the C integer format and R will create a set of files.
You can plot as many things as you want in the pdf, the plots will be added to the pdf in different pages. dev.off() closes the connection to the file and the pdf will be created and you will se something like