grantmcdermott · GitHub

MWE:

pkgload::load_all("~/Documents/Projects/tinyplot")
#> ℹ Loading tinyplot
dat = data.frame(y= 1:3, x= 1:3, yesno= c(T, F, T))
tinyplot(y ~ x | yesno, data = dat, cex = 3, pch = 16)

Aside: This ended up being a little more complicated than first expected, since you can't introduce the same logical -> factor coercion for x and y (b/c it creates downstream problems for any types that rely on predict internally, like type_lm, type_loess, etc). As a result, this doesn't give you the desired outcome out of the gate:

tinyplot(y ~ yesno | x, data = dat, cex = 3, pch = 16)

To "fix", you need an explicit coercion to factor as part of the call:

tinyplot(y ~ factor(yesno) | x, data = dat, cex = 3, pch = 16, type = "p")

I'd love to provide a robust fix for the this x/y logical issue down the line (which doesn't mess up the predict-dependent methods, but that will take more time than I have right now.

Read the original on github.com ↗