Ordered factors
- Ordered factors, created with ordered(), imply a strict ordering and equal distance between levels:
## [1] a b c
## Levels: a < b < c
- If you map an ordered factor to color or fill in ggplot2, it will default to
scale_color_viridis()
orscale_fill_viridis()
. - If you use an ordered function in a linear model, it will use ‘polygonal contrasts’. These are mildly useful and you can learn more here:
vignette("contrasts", package = "faux")
by Lisa DeBruine.