Closes #153.
(Also address the numeric ~ factor case first mentioned in #2.)
Examples:
pkgload::load_all("~/Documents/Projects/tinyplot/") #> ℹ Loading tinyplot
Basic boxplot
plt(weight ~ Time, data = ChickWeight, type = "boxplot")
We can pass canonical boxplot arguments too, e.g.
plt(weight ~ Time, data = ChickWeight, type = "boxplot", horizontal = TRUE, staplewex = 0, lty = 1)
Grouped boxplots are automatically and correctly adjusted.
plt(weight ~ Time | Diet, data = ChickWeight, type = "boxplot")
We can facet too (here: combined with grouping but that's optional).
plt(weight ~ Time | Diet, data = ChickWeight, type = "boxplot", facet = "by")
Finally, note that we automatically implement a boxplot type if y is numeric and x is a factor (in line with vanilla plot() and as per #2).
plt(weight ~ factor(Time), data = ChickWeight)
Created on 2024-07-05 with reprex v2.1.0