I managed to plot the dataframes that are contained in a list I created like this
for (i in seq_along(df)){
plots <- lapply(listL, function(x)
ggplot(x, aes(x, y)) +
geom_jitter(...) +
geom_smooth(...) +
...
ggtitle(title))
}
I made one separate data-frame for overview that looks like this, the plots are not based on this df.
overviewdf.
Variable1 Year Name Variable2
1 xxxx 1000 Name1 a
2 xxxx 1001 Name1 b
3 xxxx 1002 Name1 a
4 xxxx 1003 Name2 b
5 xxxx 1004 Name2 b
6 xxxx 1004 Name2 b
7 xxxx 1005 Name2 a
8 xxxx 1006 Name3 a
Is there any way I can include the year, and the name linked to it, to the plot title? How do I facet_wrap plots according to the names they're linked with?
Thank you for your help!