I have R code (using ggplot2) that pumps out a bunch of charts to PDF and I'm happy with the layout. I just want to slap on a decent-looking title page which is just some centered text. Google seems to produce a lot of support for Sweave - except that the workflow is really bizarre to me (i.e. embed my R in sweave, run sweave from R). Also, I don't want to onboard a bunch of new programs to get this to work. Also, I have a ton of R code that produces the charts and I'm happy with the flow-of-control (i.e. run r script, r script writes plots to pdf). Ideally, I just want to print a title page to the PDF, print my plots, close the device, and call it a day. How would I do this?
Final DraftGo to File > Save As PDF and check or clear the Include Title Page checkbox. If you are using a filtered PDF export (under File > Print), check or clear the Include Title Page checkbox there.
Windows: Go to File > Print and towards the bottom of the window make sure there is a check in the Include Title Page box. Click OK and the script will print out with the title page.
Since you want to do it totally within R, this could work, but it is a poor substitute for using actual typesetting software (as opposed to statistical analysis software) to make title pages:
#pdf(...)
plot(0:10, type = "n", xaxt="n", yaxt="n", bty="n", xlab = "", ylab = "")
text(5, 8, "This is the title")
text(5, 7, "This is my name")
text(5, 6, "This is the date")
#plot(...)/xyplot(...)/ggplot(...) your plots
#dev.off()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With