Hi,
I work in agronomy, I study the density along pieces of wood.
With R I know how to draw the density profile for many cores and print them in a PDF, one core per page.
But now I have more than 1000 cores to draw, and I don't want to have 1000 pages in my PDF. So I would like to have 9 plots on each page (a square of 3x3) to reduce the number of pages.
And I don't find how to do it, because i don't want to organise differents plots with facet_grid, and I don't know how much pages I will have (it depends on the species)
I put my code below, it's the code I use for one plot per page.
pdf("TEST.pdf")
by(data, data$Code,function(x) {
ggplot()+
geom_line(x, mapping=(aes(x=posR,y=dens)))+
geom_point(x,mapping=(aes(x=posR,y=moyseg)),color="#33CCFF",size=2)+
geom_line(x,mapping=(aes(x=posR,y=Dr1)),color="#FF0033",size=1,linetype="dashed")+
labs(x="position relative", y="densité", title = unique(x$lib_espar))
})
dev.off()
If anyone have a clue or an idea i'd be very grateful