I am trying to save multiple ggplots that essentially do a histogram of each column. Ideally I would like to have 2 or 3 graphs per page, but for now I am fine with just 1 per page. The ggplots look fine, but I cannot seem to get the ggplots to save correctly(although probably not doing it correctly).
item_set <- unique(df$Item_number)
for(i in 1:length(item_set)){
n <- as.character(item_set[i])
temp <- wide_data[, grep(n, names(wide_data))]
temp <- temp[, grep("Time", names(temp))]
coln <- colnames(temp)
ggplot(data = temp, aes_string(x = coln)) + geom_histogram(color = "black", fill = "white", bins = 70)
ggsave("Time Spent - Entire Sample.pdf")
}
So for each ggplot, it is basically just taking column by column, by column name(coln) and creating a histogram. How can I save all of these to a single pdf?