For example, this should default to type_boxplot().
library(tinyplot)
set.seed(0)
x <- rep(c("A", "B", "C"), each = 20)
y <- runif(60)
gp <- sample(c("X", "Y", "Z"), size = 60, replace = TRUE)
df <- data.frame(x, y, gp)
plt(
y ~ x | gp,
data = df
)
#> Error in Summary.factor(structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, : 'range' not meaningful for factors
Separately, we shouldn't run into errors when x or y are characters/factors for points anyway. (This is the error above.) I'll address both issues in a PR shortly.
P.S. We coerce characters to factors lower in the main tinyplot.R code, but type sanitizing needs to happen earlier here.
For example, this should default to
type_boxplot().Separately, we shouldn't run into errors when
xoryare characters/factors for points anyway. (This is the error above.) I'll address both issues in a PR shortly.P.S. We coerce characters to factors lower in the main
tinyplot.Rcode, but type sanitizing needs to happen earlier here.