Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

easiest way to write a title page to pdf without Sweave

Tags:

r

pdf

sweave

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?

like image 416
SFun28 Avatar asked Apr 19 '11 14:04

SFun28


People also ask

How do I save final draft as a title page in PDF?

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.

How do I export a final draft script to a title page?

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.


1 Answers

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()

Title Page in R

like image 58
Greg Avatar answered Sep 28 '22 09:09

Greg