In the following list, there are several data frames representing time series of some variable:
list.data <- list(data.frame(x=c(1:10), y=rnorm(10)),data.frame(x=c(11:20), y=rnorm(10)))
How can I plot these time series in one graph using ggplot by looping without the need of making the entry manually.
when I tried using lapply each time series has been plotted in a different graph.
lapply(list.data, function(z){ggplot()+geom_line(data=z, aes(x, y))})
manually plot is tedious as I have so many items on the list
ggplot()+geom_line(data=list.data[[1]], aes(x, y))+
geom_line(data=list.data[[2]], aes(x, y), col='red')
Is there any easy way to plot without repeating geom_line several times
