You can plot three different time series of different lengths in a single ggplot2 plot by first merging the three datasets into one using dplyr::full_join
or merge
. Then, you can melt the data into a long format using reshape2::melt
or tidyr::gather
functions. Finally, you can use ggplot2::geom_line
to plot the time series.
Here is some example code:
main.r705 chars19 lines
This will give you a plot with three different time series of different lengths in different colors.
gistlibby LogSnag