I have never used facet_wrap_paginate before and am not finding any good examples of how to use it. Normally I use facet_wrap but save it as one plot and just increase the height and width.
Below I have put a simple example of the code I normally use to produce/save plots. Please note this is a very reduced version for the sake of simplicity.
Draft <-
ggplot(aes(x, y) +
geom_boxplot()
ggsave(plot = Draft, "./Draft.jpeg", width = 15, height = 10, units = "cm")
However, I want to produce a multi-page PDF for the separated out by plot, using facet_wrap_paginate. When I ran the code (example below) I recieved no errors but was unable to find the output anywhere.
Draft <-
ggplot(aes(x, y) +
geom_boxplot() +
facet_wrap_paginate(~ chemical)
My understanding is, that
ggforce::facet_wrap_paginate()will produce separate plots of subsets of facets. You'd still have to place them in a pdf.According to your description, you want plots of subsets of your dataset on separate pages of a PDF document.
Here is an example of how to do that without
facet_wrap_paginate()in a quarto document. The idea is to split the dataset into subsets, then plot them with afig.heightso that each plot takes up one page.