-
Notifications
You must be signed in to change notification settings - Fork 20
Formula extensions #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Formula extensions #537
Conversation
|
When checking how the https://github.com/grantmcdermott/tinyplot/blob/main/R/sanitize_type.R#L45-L55 I would recommend that we add support for the following:
Note, however, that the latter two are not consistent with the base R |
Thanks @zeileis and I agree. We should follow base plot conventions where possible, but be fine to deviate in cases like this where it makes sense. Do you want to tackle these univariate cases in this PR, or a separate one? Everything else looks good, except the axis label as you say. I'd need to play around with the code a bit to see the best place to fix. |
|
Thanks for the feedback! I think it makes sense to include the univariate defaults in this PR because we can think about which formulas map to which x/y specifications which in turn map to plot types. I'll try to post a suggestion later today... |
|
Hi @zeileis. Just a ping to see if you still want to take a look at the axis labeling issue. If not, I should have time next week. |
- x = <factor>, y = NULL: barplot - x = NULL, y = <factor>: barplot - x = NULL, y = !<factor>: histogram - x = !<factor>, y = NULL: scatterplot against index (previous default) note that the cases with x = NULL necessitate switching settingsx and settings$y axis labels still need fixing
|
Apologies for the long delay - university politics got into the way (and then the end of the semester). I finally had a stab at the defaults for the https://github.com/grantmcdermott/tinyplot/blob/formula-extensions/R/sanitize_type.R#L45-L68 A couple of comments:
Grant @grantmcdermott would you be able to look at the labeling issues (both from this post and the very first item in this issue)? Examples:
|

Fixes #534
With this PR
tinyplotallows formulas withoutxvariable, e.g., as in~ 1or~ 0ory ~ 1ory ~ 0etc. All of these are translated tox = NULLin the default method call.Note that the axis labels are not ideal, though. I wasn't sure where this would best be sanitized.