Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
^.*\.Rproj$
^\.Rproj\.user$
LICENSE
^\.travis\.yml$
^\_pkgdown\.yml$
^README\.md$
.gitignore
.git/*
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
# build dev site on merged pushes
push:
branches: [main, master]
# build full site on releases
release:
types: [published]
workflow_dispatch:

name: pkgdown.yaml

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
cancel-in-progress: true
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::., any::withr, stan-dev/pkgdown-config

- name: Build site
run: |
withr::with_envvar(
c("NOT_CRAN" = "true"), # this should already be set by setup-r@v2? keeping because vignettes don't build otherwise
pkgdown::build_site_github_pages(
lazy = FALSE, # change to TRUE if runner times out.
run_dont_run = TRUE,
new_process = TRUE
)
)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
2 changes: 1 addition & 1 deletion R/bayesplot-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @description
#' \if{html}{
#' \figure{stanlogo.png}{options: width="50" alt="mc-stan.org"}
#' \figure{logo.svg}{options: width="50" alt="mc-stan.org"}
#' }
#' *Stan Development Team*
#'
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# bayesplot <img src="man/figures/stanlogo.png" align="right" width="120" />
# bayesplot <img src="man/figures/logo.svg" align="right" width="120" />

<!-- badges: start -->
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/bayesplot?color=blue)](https://cran.r-project.org/web/packages/bayesplot)
[![Downloads](https://cranlogs.r-pkg.org/badges/bayesplot?color=blue)](https://cran.rstudio.com/package=bayesplot)
[![R-CMD-check](https://github.com/stan-dev/bayesplot/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/stan-dev/bayesplot/actions/workflows/R-CMD-check.yaml)
[![R-CMD-check](https://github.com/stan-dev/bayesplot/actions/workflows/R-CMD-check.yaml/badge.svg)](https://raw.githubusercontent.com/stan-dev/bayesplot/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/stan-dev/bayesplot/branch/master/graph/badge.svg)](https://codecov.io/gh/stan-dev/bayesplot)
<!-- badges: end -->

Expand Down Expand Up @@ -35,17 +35,17 @@ and the paper _Visualization in Bayesian workflow_:
_J. R. Stat. Soc. A_, 182: 389-402. doi:10.1111/rssa.12378.
([journal version](https://rss.onlinelibrary.wiley.com/doi/full/10.1111/rssa.12378),
[arXiv preprint](https://arxiv.org/abs/1709.01449),
[code on GitHub](https://github.com/jgabry/bayes-vis-paper))
[code on GitHub](https://raw.githubusercontent.com/jgabry/bayes-vis-paper))

### Resources

* [mc-stan.org/bayesplot](https://mc-stan.org/bayesplot) (online documentation, vignettes)
* [Ask a question](https://discourse.mc-stan.org) (Stan Forums on Discourse)
* [Open an issue](https://github.com/stan-dev/bayesplot/issues) (GitHub issues for bug reports, feature requests)
* [Open an issue](https://raw.githubusercontent.com/stan-dev/bayesplot/issues) (GitHub issues for bug reports, feature requests)

### Contributing

We are always looking for new contributors! See [CONTRIBUTING.md](https://github.com/stan-dev/bayesplot/blob/master/.github/CONTRIBUTING.md) for details and/or reach out via the issue tracker.
We are always looking for new contributors! See [CONTRIBUTING.md](https://raw.githubusercontent.com/stan-dev/bayesplot/master/.github/CONTRIBUTING.md) for details and/or reach out via the issue tracker.

### Installation

Expand All @@ -55,7 +55,7 @@ We are always looking for new contributors! See [CONTRIBUTING.md](https://github
install.packages("bayesplot")
```

* Install latest development version from GitHub (requires [devtools](https://github.com/hadley/devtools) package):
* Install latest development version from GitHub (requires [devtools](https://raw.githubusercontent.com/hadley/devtools) package):

```r
if (!require("devtools")) {
Expand Down Expand Up @@ -88,15 +88,15 @@ mcmc_areas(posterior,
prob = 0.8) + plot_title
```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/mcmc_areas-rstanarm.png width=50%/>
<img src="https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/mcmc_areas-rstanarm.png" width="50%">

```r
color_scheme_set("red")
ppc_dens_overlay(y = fit$y,
yrep = posterior_predict(fit, draws = 50))
```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/ppc_dens_overlay-rstanarm.png width=50%/>
<img src=https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/ppc_dens_overlay-rstanarm.png width=50%/>

```r
# also works nicely with piping
Expand All @@ -110,7 +110,7 @@ fit %>%

```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/ppc_stat_grouped-rstanarm.png width=50%/>
<img src=https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/ppc_stat_grouped-rstanarm.png width=50%/>

```r
# with rstan demo model
Expand All @@ -124,7 +124,7 @@ p <- mcmc_trace(posterior2, pars = c("mu", "tau"), n_warmup = 300,
p + facet_text(size = 15)
```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/mcmc_trace-rstan.png width=50% />
<img src=https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/mcmc_trace-rstan.png width=50% />

```r
# scatter plot also showing divergences
Expand All @@ -137,15 +137,15 @@ mcmc_scatter(
)
```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/mcmc_scatter-rstan.png width=50% />
<img src=https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/mcmc_scatter-rstan.png width=50% />

```r
color_scheme_set("red")
np <- nuts_params(fit2)
mcmc_nuts_energy(np) + ggtitle("NUTS Energy Diagnostic")
```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/mcmc_nuts_energy-rstan.png width=50% />
<img src=https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/mcmc_nuts_energy-rstan.png width=50% />

```r
# another example with rstanarm
Expand All @@ -168,4 +168,4 @@ ppc_intervals(
grid_lines(color = "white")
```

<img src=https://github.com/stan-dev/bayesplot/blob/master/images/ppc_intervals-rstanarm.png width=55% />
<img src=https://raw.githubusercontent.com/stan-dev/bayesplot/master/images/ppc_intervals-rstanarm.png width=55% />
131 changes: 131 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
url: https://mc-stan.org/bayesplot

development:
mode: auto

destination: "."

template:
package: pkgdownconfig

navbar:
title: "bayesplot"

structure:
left: [home, vignettes, functions, news, pkgs, stan]
right: [search, bluesky, forum, github, lightswitch]

components:
pkgs:
text: Other Packages
menu:
- text: cmdstanr
href: https://mc-stan.org/cmdstanr
- text: loo
href: https://mc-stan.org/loo
- text: posterior
href: https://mc-stan.org/posterior
- text: projpred
href: https://mc-stan.org/projpred
- text: rstan
href: https://mc-stan.org/rstan
- text: rstanarm
href: https://mc-stan.org/rstanarm
- text: rstantools
href: https://mc-stan.org/rstantools
- text: shinystan
href: https://mc-stan.org/shinystan

articles:
- title: "Getting Started"
desc: >
These vignettes provide an introduction to visualizing MCMC draws and
diagnostics and performing graphical posterior predictive checks using
the **bayesplot** package.
contents:
- plotting-mcmc-draws
- visual-mcmc-diagnostics
- graphical-ppcs

reference:
- title: "Overview"
desc: >
Package overview
contents:
- bayesplot-package
- title: "Aesthetics"
desc: >
Functions for setting the color scheme and ggplot theme used
by **bayesplot**. (Also see the separate **ggplot helpers** section
below.)
contents:
- bayesplot-colors
- bayesplot_theme_get
- theme_default
- title: "PPC"
desc: >
Functions for carrying out a wide variety of graphical model checks
based on comparing observed data to draws from the posterior or prior
predictive distribution.
contents:
- PPC-overview
- starts_with("ppc")
- pp_check
- title: "PPD"
desc: >
Functions for creating graphical displays of simulated data from the
posterior or prior predictive distribution (PPD). These plots are essentially
the same as the corresponding PPC plots but without comparing to any observed
data.
contents:
- PPD-overview
- starts_with("ppd")
- title: "MCMC"
desc: >
Functions for creating plots of MCMC draws of model parameters and
general MCMC diagnostics.
contents:
- MCMC-overview
- MCMC-diagnostics
- MCMC-distributions
- MCMC-intervals
- MCMC-recover
- MCMC-scatterplots
- MCMC-parcoord
- MCMC-traces
- MCMC-combos
- title: "HMC/NUTS diagnostics"
desc: >
Functions for plotting diagnostics specific to Hamiltonian Monte Carlo (HMC)
and the No-U-Turn Sampler (NUTS). Some of the general MCMC plotting functions
(`mcmc_parcoord()`, `mcmc_pairs()`, `mcmc_scatter()`, `mcmc_trace()`) can also
show HMC/NUTS diagnostic information if optional arguments are specified,
but the special functions below are _only_ intended for use with HMC/NUTS.
contents:
- MCMC-nuts
- title: "Tidy parameter selection for MCMC plots"
desc: >
Helper functions for tidy parameter selection and examples of using
**bayesplot** with [**dplyr**](https://dplyr.tidyverse.org/).
contents:
- tidy-params
- title: "ggplot helpers"
desc: >
Convenience functions for arranging multiple plots, adding features
to plots, and shortcuts for modifying individual ggplot theme elements.
contents:
- bayesplot_grid
- bayesplot-helpers
- title: "Extractors"
desc: >
Functions extracting various quantities needed for plotting from different
types of fitted model objects.
contents:
- bayesplot-extractors
- title: "Miscellaneous"
desc: >
Functions for generating data for examples and listing available
plotting functions.
contents:
- example-data
- available_ppc
2 changes: 1 addition & 1 deletion man/bayesplot-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading