-
-
Notifications
You must be signed in to change notification settings - Fork 87
add ppc_*_overlay_grouped functions #212
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
Conversation
The plots now have axis lines. (Note the addition of the vertical y-axis lines compared to the original versions above.) library(bayesplot)
#> This is bayesplot version 1.7.1
#> - Online documentation and vignettes at mc-stan.org/bayesplot
#> - bayesplot theme set to bayesplot::theme_default()
#> * Does _not_ affect other ggplot2 plots
#> * See ?bayesplot_theme_set for details on theme setting
y <- example_y_data()
yrep <- example_yrep_draws()
group <- example_group_data()
ppc_dens_overlay_grouped(y, yrep[1:20,], group = group) ppc_ecdf_overlay_grouped(y, yrep[1:20,], group = group) Created on 2019-12-02 by the reprex package (v0.3.0) |
Ready for review. Travis won't build it because of BH issues and rhub fails when trying to install BiocManager but the checks on my Windows 10 machine all pass. I do get warnings during tests about our use of |
Oops, this breaks code from the brms package.
|
Wow, sorry it took me forever to get to this @tjmahr! This looks great.
@paul-buerkner is there something in brms that can be changed for this to not cause an error? |
@tjmahr Coming back to this, I looked into the brms issue and I think the reason this causes an error in brms is that as part of this PR |
I think if we wait on this until we deal with #151 then we can use the new mechanism for the grouped plots calling the ungrouped version. That should get around the brms error. |
#253 which was just opened reminded me of this. @tjmahr is there a reason |
library(bayesplot)
#> This is bayesplot version 1.7.2.9000
#> - Online documentation and vignettes at mc-stan.org/bayesplot
#> - bayesplot theme set to bayesplot::theme_default()
#> * Does _not_ affect other ggplot2 plots
#> * See ?bayesplot_theme_set for details on theme setting
y <- example_y_data()
yrep <- example_yrep_draws()
group <- example_group_data()
ppc_dens_overlay_grouped(y, yrep[1:20,], group = group) y <- example_y_data()
yrep <- example_yrep_draws()
group <- example_group_data()
ppc_ecdf_overlay_grouped(y, yrep[1:20,], group = group) Created on 2020-12-03 by the reprex package (v0.3.0) |
I removed the group argument from |
# data in the y and yrep layers should be safe because they are | ||
# specified using a function on the main plot data. | ||
data <- ppc_data(y, yrep, group = group) | ||
p_overlay <- p_overlay + list(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't even know about this trick!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or I maybe did but had since forgotten. Either way, this seems seems good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this @tjmahr. I think it's ready to go but will let all the checks finish running.
Created on 2019-12-02 by the reprex package (v0.3.0)