I would suggest against use the facet_wrap() if you want each plot to be on a different page. We can utilize purrr::map() to make a list of plots and then do a for loop to print to a .pdf file.We could also do map() to do that, but it was the first thing that came to mind.
library(tidyverse)
Infil_Data <- tibble::tribble(
~Time.x, ~Site.ID, ~Sqrt_Time.x, ~Calc_Vol_cm,
0L, "A1", 0, 0L,
30L, "A1", 5.477225575, 1L,
60L, "A1", 7.745966692, 2L,
90L, "A1", 9.486832981, 3L,
120L, "A1", 10.95445115, 4L,
150L, "A1", 12.24744871, 5L,
180L, "A1", 13.41640786, 6L,
210L, "A1", 14.49137675, 7L,
240L, "A1", 15.49193338, 8L,
270L, "A1", 16.43167673, 9L,
300L, "A1", 17.32050808, 10L,
0L, "A2", 0, 0L,
30L, "A2", 5.477225575, 2L,
60L, "A2", 7.745966692, 4L,
90L, "A2", 9.486832981, 6L,
120L, "A2", 10.95445115, 8L,
150L, "A2", 12.24744871, 10L,
180L, "A2", 13.41640786, 12L,
210L, "A2", 14.49137675, 14L,
240L, "A2", 15.49193338, 16L,
270L, "A2", 16.43167673, 18L,
300L, "A2", 17.32050808, 20L
)
plot_lst <- Infil_Data %>%
split(.$Site.ID) %>%
map(~ggplot(data = .x) +
geom_point(mapping = aes(x = Sqrt_Time.x, y = Calc_Vol_cm)))
pdf("allplots.pdf",onefile = TRUE)
walk(plot_lst, print)
dev.off()
#> quartz_off_screen
#> 2
Created on 2019-01-16 by the reprex package (v0.2.1)
So what we did was create a list of tibbles split by the Site.ID column that you were originally using for your facet_wrap() we then pass each tibble to a ggplot mapper used by the map which gives us a list of plots. We then print those plots individually to a .pdf.