I have this code
pdf("~/BoxplotsToday.pdf")
for (i in unique(datanew$Trait)){
print( datanew %>%
filter(between(value, 0, 2)) %>% filter(Marker %in% levels(datanew$Marker)) %>%
ggplot(aes(x= value, y = audpc, fill= value))+ geom_boxplot()+
facet_wrap_paginate(~Marker, nrow=3, ncol = 5, page = i))
}
dev.off()
I want to save several box plots in a pdf but it is not working. Can someone please help me?