You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for categorical variables in type_summary() #436
I think it would be interesting to allow for the support of categorical variables in the x axis for summary plots, similar to ggplot, so that you could have something like
plt(bill_length_mm ~ species, data = penguins, type = type_summary(mean_se))
And get this in return
I'd be happy to give it a go, if you think it would be useful!
Thanks in advance,
Thanks for the suggestion. The tricky thing is that you'd need to amend type_summary so that it does two new things: (a) understands array returns with y, ymin, and ymax, and (b) can dynamically switch drawing types instead of just reverting to type_lines().
(a) would require a major refactor since we couldn't just rely on ave() anymore for the internal conversion. (b) would be complicated on its own, although potentially doable via a draw_type argument or similar.
Given this, my guess is that it would be easier just to call plt(..., data = mean_se(bill_length_mm ~ species, penguins), type = "pointrange").
Activity
grantmcdermott commentedon Jul 12, 2025
Thanks for the suggestion. The tricky thing is that you'd need to amend
type_summaryso that it does two new things: (a) understands array returns with y, ymin, and ymax, and (b) can dynamically switch drawing types instead of just reverting totype_lines().(a) would require a major refactor since we couldn't just rely on
ave()anymore for the internal conversion. (b) would be complicated on its own, although potentially doable via adraw_typeargument or similar.Given this, my guess is that it would be easier just to call
plt(..., data = mean_se(bill_length_mm ~ species, penguins), type = "pointrange").