Skip to content

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

Merged
jgabry merged 6 commits intostan-dev:masterfrom
ishaan-arora-1:docs/data-functions-vignette-435
Mar 26, 2026
Merged

Add vignette sections for *_data() companion functions#439
jgabry merged 6 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-commenter commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (617650b) to head (8dc1dc9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #439   +/-   ##
=======================================
  Coverage   98.67%   98.67%           
=======================================
  Files          35       35           
  Lines        5903     5903           
=======================================
  Hits         5825     5825           
  Misses         78       78           

☔ 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.

@florence-bockting
Copy link

florence-bockting commented Mar 26, 2026

Looks good to me now. Just double checking with @jgabry before merging.

Copy link
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too now, thank you!

@jgabry
Copy link
Member

jgabry commented Mar 26, 2026

The checks are running again now (I merged in master again) but once they pass we can merge

@jgabry jgabry merged commit bd8b804 into stan-dev:master Mar 26, 2026
10 of 11 checks passed
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

4 participants