Skip to content

Add vignette sections for *_data() companion functions#439

Open
ishaan-arora-1 wants to merge 5 commits intostan-dev:masterfrom
ishaan-arora-1:docs/data-functions-vignette-435
Open

Add vignette sections for *_data() companion functions#439
ishaan-arora-1 wants to merge 5 commits intostan-dev:masterfrom
ishaan-arora-1:docs/data-functions-vignette-435

Conversation

@ishaan-arora-1
Copy link
Contributor

@ishaan-arora-1 ishaan-arora-1 commented Mar 10, 2026

Fixes #435

Added vignette sections in the PPC and MCMC vignettes demonstrating how to use the *_data() companion functions for building custom ggplot2 visualizations, as requested in the issue.

AI Usage policy :
Parts of the documentation were generated using an llm

Add usage examples in the PPC and MCMC vignettes showing how to use
*_data() functions to extract pre-processed data for custom ggplot2
visualizations.

Fixes stan-dev#435
ishaan-arora-1 added a commit to ishaan-arora-1/bayesplot that referenced this pull request Mar 10, 2026
Placed the section after "Providing an interface" and before
"References" so it doesn't conflict with the *_data() section
that PR stan-dev#439 adds at line 315.
@florence-bockting
Copy link

florence-bockting commented Mar 13, 2026

Thank you @ishaan-arora-1 for your PR and working on this issue.

I noticed that the checks currently fail as the object 'yrep' in your example code does not exist. Can you please have a look at this?

In general it is a good idea to check whether you can build and render a modified .Rmd document locally. This allows you to catch already some errors. To build all vignettes you can run from the package root: devtools::build_vignettes().

Furthermore, to render the graphical-ppc.Rmd locally you can use for example: rmarkdown::render('vignettes/graphical-ppcs.Rmd', params=list(EVAL=TRUE), output_dir='inst/doc')
(adjust the output directory as needed). When you render the Rmd you will notice the error message.

ishaan-arora-1 and others added 2 commits March 13, 2026 18:14
The vignette defines yrep_poisson and yrep_nb but never a bare yrep.
Use yrep_nb (the better-fitting model) in the ppc_intervals_data() and
ppc_stat_data() examples so the vignette renders without error.
@ishaan-arora-1
Copy link
Contributor Author

Thank you @ishaan-arora-1 for your PR and working on this issue.

I noticed that the checks currently fail as the object 'yrep' in your example code does not exist. Can you please have a look at this?

In general it is a good idea to check whether you can build and render a modified .Rmd document locally. This allows you to catch already some errors. To build all vignettes you can run from the package root: devtools::build_vignettes().

Furthermore, to render the graphical-ppc.Rmd locally you can use for example: rmarkdown::render('vignettes/graphical-ppcs.Rmd', params=list(EVAL=TRUE), output_dir='inst/doc') (adjust the output directory as needed). When you render the Rmd you will notice the error message.

Thanks a lot for catching that. The vignette defines yrep_poisson and yrep_nb but never a bare yrep and I should have caught that before pushing. il fix the pr, ill do as youve instructed. and i'll ask for a re-review once im done!!

@florence-bockting
Copy link

From my side this looks fine now. Can you just check the failing tests @ishaan-arora-1 ?

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (b19e3cd) to head (cc7f64f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #439      +/-   ##
==========================================
+ Coverage   98.67%   98.71%   +0.03%     
==========================================
  Files          35       35              
  Lines        5904     5904              
==========================================
+ Hits         5826     5828       +2     
+ Misses         78       76       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add documentation for pp*_data() companion functions

3 participants