-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Plot method for data_tabulate
#293
Conversation
A few comments:
|
Looking good! Error bars? |
@bwiernik did you have something like this in mind? Default is to add error bars (I just took the code from library(see)
library(datawizard)
library(patchwork)
x <- data_tabulate(mtcars, select = "cyl")
plot(x, remove_na = TRUE)
#> [[1]] plot(x, remove_na = TRUE, error_bar = FALSE)
#> [[1]] Created on 2023-06-02 with reprex v2.0.2 |
Remaining tests failures are not caused by this PR, they are also on |
I think this can be merged? |
I'm making some tweaks |
1. change `remove_na` to `show_na` and set default to conditionally show the missing category if any NA are present 2. use the Wilson confidence interval rather than the normal approximation to avoid CIs that escape the [0, 1] bounds 3. namespace ggplot2 functions 4. add arguments for the column and error bar colors, defaulting to blue hues for each
1ca219c
to
e04947a
Compare
okay, I made those tweaks. The major one is to use the Wilson CI for proportions rather than the normal approximation -- this avoids getting CI bounds that escape [0, 1] or intervals collapsing to nothing at p = 0 or 1 |
this is ready to merge assuming checks still pass |
@IndrajeetPatil do you know why the R-CMD-check-strict on ubuntu is taking forever to load all of the dependencies? |
The automated checks for the see package are a pain, because there are a lot of minor issues, which yield an error (on purpose), but which are difficult to iron out in order to have a "clean basis" for tests. |
Possibly due to this issue: r-lib/vdiffr#137 |
That looks like it |
Close #289
Minimal working version so far (no docs, etc.). It is such a short step to convert the table into a plot that I think we should restrict the number of args to a minimum here. Otherwise it will just be quicker for the users to make a fancy plot by themselves than go through all possible args (e.g the docs of
sjPlot::plot_freq()
are a bit overwhelming 😅). I have two "important" args in mind for now:@jmgirard what do you think?