Relative Content

Tag Archive for rggplot2visualizationgeom

Calendar plot with geom_segment()

I have the following dataset in R. I aim to do a ggplot where the scale goes from 1 to 12 (January, February, …, December) in the x-axis, and the y-axis goes from 1 to 6 ( num_months variable [in the example only 1 and 6]). Then, I want to use geom_segment(), with the minimum being start_month and the maximum being end_month (so they represent the num_months). I want to facet horizontally by the variable year.