[R] Creating pdf report

baptiste auguie baptiste.auguie at googlemail.com
Sun Jun 6 22:37:49 CEST 2010


Hi,

ggplot2 and lattice also provide convenient ways to arrange multiple
plots on a page. For tables, there's also a function based on Grid
graphics in the gridExtra package.

A typical dummy example might be,

library(ggplot2)
library(gridExtra)

p = qplot(Sepal.Length, Petal.Length, data=iris, colour=Species) +
facet_grid(~Species)
tab = tableGrob(head(iris))

pdf("plotandtable.pdf")
arrange(p, tab)
dev.off()


HTH,

baptiste


On 6 June 2010 19:26,  <bjlwilkinson at gmail.com> wrote:
> I'm looking for a way to create a pdf report that contains multiple graphs on one page as well as tables (ideally with some lines below categories etc.) . I have used the pdf(filename) followed by dev.off() to date but this prints one graph per page and does not seem to have functionality for tables.
> Thanks
>
> Sent from my BlackBerry® wireless device
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
____________________

Baptiste Auguié

Departamento de Química Física,
Universidade de Vigo,
Campus Universitario, 36310, Vigo, Spain

tel: +34 9868 18617
http://webs.uvigo.es/coloides



More information about the R-help mailing list