There is a loop generate the multiple plots. My question is I want the title name change for each iteration. for example "plot1","plot2","plot3".........
what if I want a sentence for the plot title, say"This is the 1 plot we have","This is the 2 plot we have"
library(tidyverse)
# create a list with a specific length
plot_lst <- vector("list", length = 8)
for (i in 1:8) {
g <- ggplot(data = mtcars, aes(x = hp, y = wt)) +
geom_point()+ggtitle("plot1")
plot_lst[[i]] <- g
}
# Combine all plots
cowplot::plot_grid(plotlist = plot_lst, nrow = 4)