Currently I am looking for a solution to save 72 plots to an PDF file.
Those 72 plots are created through a function
and the below code of repeat
.
The ID stands for a person within my dataset. This person has multiple rows of data attached to his ID. To go to the next person I use ID = ID + 1
With the below code I manage to create an PDF file but, this is a PDF file with 72 pages. I would like to have 4 plots on each row. Something in the idea of nrow = 4 like you use in grid.arrange. Preferably 4 on each row and 24 on each page.
pdf("plot1.pdf")
repeat {
ID = ID + 1
print(ggplot(ID))
if (ID == 72){
break}}
dev.off()
I am still not sure wether this is a legit solution but at least it is fixed now!
Apparently I was looking for a solution like this: