Standardise season as a factor with ordered seasons. If an "annual" category is present it includes at the end of the other seasons. Season names are converted to sentence case
order_season_levels(x)
x | character vector. If a factor will be coerced to character first |
---|
a factor with ordered levels for season
library(ggplot2) library(tibble) seasons <- tribble( ~ season, ~n, "autum", 1, "summer", 2, "winter", 3, "spring", 1, "annual", 2) # unordered ugly plot qplot(season, n, fill = season, data = seasons, geom = "col")#> Warning: Autum not recognised as valid season name(s)