I have a data frame that I would like to write to a pdf file in an organized manner.
For example, my df looks like this:
Date County Trade 1/1/2012 USA 5 1/1/2012 Japan 4 1/2/2012 USA 10 1/3/2012 Germany 15
I would like to output the group by date, put a space or line break after each group;
I have this piece of code, but it prints everything in a pdf file without grouping:
library(gridExtra) pdf("trade.pdf", height=11, width=8.5) grid.table(df) dev.off()
Any ideas how best to present this dataset in a pdf file grouped by date? I like to use grid.Extra. Does anyone know how to put a header in grid.Extra?
source share