Skip to content

Commit 987ef3c

Browse files
authored
Merge pull request #378 from stan-dev/new-pkgdown-setup
New pkgdown theme
2 parents fda764c + 9cee9ae commit 987ef3c

File tree

10 files changed

+205
-112
lines changed

10 files changed

+205
-112
lines changed

.Rbuildignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
^.*\.Rproj$
44
^\.Rproj\.user$
55
LICENSE
6-
^\.travis\.yml$
6+
^\_pkgdown\.yml$
77
^README\.md$
88
.gitignore
99
.git/*

.github/workflows/pkgdown.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
# build dev site on merged pushes
5+
push:
6+
branches: [main, master]
7+
# build full site on releases
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
name: pkgdown.yaml
13+
14+
jobs:
15+
pkgdown:
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
20+
cancel-in-progress: true
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: r-lib/actions/setup-pandoc@v2
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
use-public-rspm: true
33+
34+
- uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::pkgdown, local::., any::withr, stan-dev/pkgdown-config
37+
38+
- name: Build site
39+
run: |
40+
withr::with_envvar(
41+
c("NOT_CRAN" = "true"), # this should already be set by setup-r@v2? keeping because vignettes don't build otherwise
42+
pkgdown::build_site_github_pages(
43+
lazy = FALSE, # change to TRUE if runner times out.
44+
run_dont_run = TRUE,
45+
new_process = TRUE
46+
)
47+
)
48+
shell: Rscript {0}
49+
50+
- name: Deploy to GitHub pages 🚀
51+
uses: JamesIves/[email protected]
52+
with:
53+
clean: false
54+
branch: gh-pages
55+
folder: docs

R/bayesplot-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#'
99
#' @description
1010
#' \if{html}{
11-
#' \figure{stanlogo.png}{options: width="50" alt="mc-stan.org"}
11+
#' \figure{logo.svg}{options: width="50" alt="mc-stan.org"}
1212
#' }
1313
#' *Stan Development Team*
1414
#'

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# bayesplot <img src="man/figures/stanlogo.png" align="right" width="120" />
1+
# bayesplot <img src="man/figures/logo.svg" align="right" width="120" />
22

33
<!-- badges: start -->
44
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/bayesplot?color=blue)](https://cran.r-project.org/web/packages/bayesplot)
55
[![Downloads](https://cranlogs.r-pkg.org/badges/bayesplot?color=blue)](https://cran.rstudio.com/package=bayesplot)
6-
[![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)
6+
[![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)
77
[![codecov](https://codecov.io/gh/stan-dev/bayesplot/branch/master/graph/badge.svg)](https://codecov.io/gh/stan-dev/bayesplot)
88
<!-- badges: end -->
99

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

4040
### Resources
4141

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

4646
### Contributing
4747

48-
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.
48+
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.
4949

5050
### Installation
5151

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

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

6060
```r
6161
if (!require("devtools")) {
@@ -88,15 +88,15 @@ mcmc_areas(posterior,
8888
prob = 0.8) + plot_title
8989
```
9090

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

9393
```r
9494
color_scheme_set("red")
9595
ppc_dens_overlay(y = fit$y,
9696
yrep = posterior_predict(fit, draws = 50))
9797
```
9898

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

101101
```r
102102
# also works nicely with piping
@@ -110,7 +110,7 @@ fit %>%
110110

111111
```
112112

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

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

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

129129
```r
130130
# scatter plot also showing divergences
@@ -137,15 +137,15 @@ mcmc_scatter(
137137
)
138138
```
139139

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

142142
```r
143143
color_scheme_set("red")
144144
np <- nuts_params(fit2)
145145
mcmc_nuts_energy(np) + ggtitle("NUTS Energy Diagnostic")
146146
```
147147

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

150150
```r
151151
# another example with rstanarm
@@ -168,4 +168,4 @@ ppc_intervals(
168168
grid_lines(color = "white")
169169
```
170170

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

_pkgdown.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
url: https://mc-stan.org/bayesplot
2+
3+
development:
4+
mode: auto
5+
6+
destination: "."
7+
8+
template:
9+
package: pkgdownconfig
10+
11+
navbar:
12+
title: "bayesplot"
13+
14+
structure:
15+
left: [home, vignettes, functions, news, pkgs, stan]
16+
right: [search, bluesky, forum, github, lightswitch]
17+
18+
components:
19+
pkgs:
20+
text: Other Packages
21+
menu:
22+
- text: cmdstanr
23+
href: https://mc-stan.org/cmdstanr
24+
- text: loo
25+
href: https://mc-stan.org/loo
26+
- text: posterior
27+
href: https://mc-stan.org/posterior
28+
- text: projpred
29+
href: https://mc-stan.org/projpred
30+
- text: rstan
31+
href: https://mc-stan.org/rstan
32+
- text: rstanarm
33+
href: https://mc-stan.org/rstanarm
34+
- text: rstantools
35+
href: https://mc-stan.org/rstantools
36+
- text: shinystan
37+
href: https://mc-stan.org/shinystan
38+
39+
articles:
40+
- title: "Getting Started"
41+
desc: >
42+
These vignettes provide an introduction to visualizing MCMC draws and
43+
diagnostics and performing graphical posterior predictive checks using
44+
the **bayesplot** package.
45+
contents:
46+
- plotting-mcmc-draws
47+
- visual-mcmc-diagnostics
48+
- graphical-ppcs
49+
50+
reference:
51+
- title: "Overview"
52+
desc: >
53+
Package overview
54+
contents:
55+
- bayesplot-package
56+
- title: "Aesthetics"
57+
desc: >
58+
Functions for setting the color scheme and ggplot theme used
59+
by **bayesplot**. (Also see the separate **ggplot helpers** section
60+
below.)
61+
contents:
62+
- bayesplot-colors
63+
- bayesplot_theme_get
64+
- theme_default
65+
- title: "PPC"
66+
desc: >
67+
Functions for carrying out a wide variety of graphical model checks
68+
based on comparing observed data to draws from the posterior or prior
69+
predictive distribution.
70+
contents:
71+
- PPC-overview
72+
- starts_with("ppc")
73+
- pp_check
74+
- title: "PPD"
75+
desc: >
76+
Functions for creating graphical displays of simulated data from the
77+
posterior or prior predictive distribution (PPD). These plots are essentially
78+
the same as the corresponding PPC plots but without comparing to any observed
79+
data.
80+
contents:
81+
- PPD-overview
82+
- starts_with("ppd")
83+
- title: "MCMC"
84+
desc: >
85+
Functions for creating plots of MCMC draws of model parameters and
86+
general MCMC diagnostics.
87+
contents:
88+
- MCMC-overview
89+
- MCMC-diagnostics
90+
- MCMC-distributions
91+
- MCMC-intervals
92+
- MCMC-recover
93+
- MCMC-scatterplots
94+
- MCMC-parcoord
95+
- MCMC-traces
96+
- MCMC-combos
97+
- title: "HMC/NUTS diagnostics"
98+
desc: >
99+
Functions for plotting diagnostics specific to Hamiltonian Monte Carlo (HMC)
100+
and the No-U-Turn Sampler (NUTS). Some of the general MCMC plotting functions
101+
(`mcmc_parcoord()`, `mcmc_pairs()`, `mcmc_scatter()`, `mcmc_trace()`) can also
102+
show HMC/NUTS diagnostic information if optional arguments are specified,
103+
but the special functions below are _only_ intended for use with HMC/NUTS.
104+
contents:
105+
- MCMC-nuts
106+
- title: "Tidy parameter selection for MCMC plots"
107+
desc: >
108+
Helper functions for tidy parameter selection and examples of using
109+
**bayesplot** with [**dplyr**](https://dplyr.tidyverse.org/).
110+
contents:
111+
- tidy-params
112+
- title: "ggplot helpers"
113+
desc: >
114+
Convenience functions for arranging multiple plots, adding features
115+
to plots, and shortcuts for modifying individual ggplot theme elements.
116+
contents:
117+
- bayesplot_grid
118+
- bayesplot-helpers
119+
- title: "Extractors"
120+
desc: >
121+
Functions extracting various quantities needed for plotting from different
122+
types of fitted model objects.
123+
contents:
124+
- bayesplot-extractors
125+
- title: "Miscellaneous"
126+
desc: >
127+
Functions for generating data for examples and listing available
128+
plotting functions.
129+
contents:
130+
- example-data
131+
- available_ppc

man/bayesplot-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)