I have been struggling with getting ggplot to place data in a meaningful way along the x axis of a chart. (I would like to show the months of October thru September, from left to right, along the axis). So far, I have been unsuccessful. Have any of you come across this situation? I have place a couple of screen shots below, to help explain.
The factor() function from base R will order the levels alphabetically unless you specify an order, but the as_factor() function from the forcats package (part of the tidyverse) defaults to the order of appearance, which is what you want in this case.
factor(c("Winter", "Spring", "Summer", "Fall", "Winter", "Spring"))
#> [1] Winter Spring Summer Fall Winter Spring
#> Levels: Fall Spring Summer Winter
forcats::as_factor(c("Winter", "Spring", "Summer", "Fall", "Winter", "Spring"))
#> [1] Winter Spring Summer Fall Winter Spring
#> Levels: Winter Spring Summer Fall