I have multiple data frames in the same format and I want to create multiple curves in the same graph using ggplot. Each data frame has data from a year, from 1956 to 2019. For example:
Year1956 <- data.frame(prob=c(5, 10, 20, 30, 100), Qmcs=c(1000, 500, 50, 10, 5))
Year1957 <- data.frame(prob=c(1, 3, 25, 35, 100), Qmcs=c(800, 600, 100, 50, 30))
It is possible to plot these multiple objects in the same graph manually, where ... would be Year1958 to Year2018
ggplot()+
geom_line(data=Year1956, aes(x=prob, y=Qmcs))+
geom_line(data=Year1957, aes(x=prob, y=Qmcs))+
...
geom_line(data=Year2019, aes(x=prob, y=Qmcs))
Is there a way of doing this in a loop, since there are many data frames? Thank you in advance.
