Skip to content

Commit f433a60

Browse files
authored
Merge branch 'master' into ppc-rootogram-grouped
2 parents 16f1338 + b1cb851 commit f433a60

65 files changed

Lines changed: 2860 additions & 710 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
env:
3030
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3131
R_KEEP_PKG_SOURCE: yes
32+
R_VERSION_TYPE: ${{ matrix.config.r }}
3233

3334
steps:
3435
- uses: actions/checkout@v6

.github/workflows/test-coverage.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ on:
77

88
name: test-coverage.yaml
99

10-
permissions: read-all
10+
permissions:
11+
contents: read
12+
id-token: write
1113

1214
jobs:
1315
test-coverage:
@@ -45,7 +47,7 @@ jobs:
4547
files: ./cobertura.xml
4648
plugins: noop
4749
disable_search: true
48-
token: ${{ secrets.CODECOV_TOKEN }}
50+
use_oidc: true
4951

5052
- name: Show testthat output
5153
if: always()
@@ -56,7 +58,7 @@ jobs:
5658

5759
- name: Upload test results
5860
if: failure()
59-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v7
6062
with:
6163
name: coverage-test-failures
6264
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ SystemRequirements: pandoc (>= 1.12.3), pandoc-citeproc
3030
Depends:
3131
R (>= 4.1.0)
3232
Imports:
33-
dplyr (>= 0.8.0),
33+
dplyr (>= 1.0.0),
3434
ggplot2 (>= 3.4.0),
3535
ggridges (>= 0.5.5),
3636
glue,
37+
lifecycle,
3738
posterior,
3839
reshape2,
39-
rlang (>= 0.3.0),
40+
rlang (>= 1.0.0),
4041
stats,
4142
tibble (>= 2.0.0),
4243
tidyr,

NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export(mcmc_dens)
7474
export(mcmc_dens_chains)
7575
export(mcmc_dens_chains_data)
7676
export(mcmc_dens_overlay)
77+
export(mcmc_dots)
78+
export(mcmc_dots_by_chain)
7779
export(mcmc_hex)
7880
export(mcmc_hist)
7981
export(mcmc_hist_by_chain)
@@ -225,3 +227,6 @@ importFrom(dplyr,top_n)
225227
importFrom(dplyr,ungroup)
226228
importFrom(dplyr,vars)
227229
importFrom(ggplot2,"%+replace%")
230+
importFrom(lifecycle,deprecate_warn)
231+
importFrom(lifecycle,deprecated)
232+
importFrom(lifecycle,is_present)

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# bayesplot (development version)
22

3+
* Fix assignment-in-call bug in `mcmc_rank_ecdf()` (#).
4+
* Replaced deprecated `dplyr` and `tidyselect` functions (`top_n`, `one_of`, `group_indices`) with their modern equivalents to ensure future compatibility. (#431)
5+
* Documentation added for all exported `*_data()` functions (#209)
6+
* Improved documentation for `binwidth`, `bins`, and `breaks` arguments to clarify they are passed to `ggplot2::geom_area()` and `ggdist::stat_dots()` in addition to `ggplot2::geom_histogram()`
7+
* Improved documentation for `freq` argument to clarify it applies to frequency polygons in addition to histograms
8+
* Fixed test in `test-ppc-distributions.R` that incorrectly used `ppc_dens()` instead of `ppd_dens()` when testing PPD functions
9+
* New functions `mcmc_dots` and `mcmc_dots_by_chain` for dot plots of MCMC draws by @behramulukir (#402)
10+
* Default to `quantiles=100` for all dot plots by @behramulukir (#402)
11+
312
# bayesplot 1.15.0
413

514
* Add `shape` argument to `mcmc_scatter` by @behramulukir (#375)

R/bayesplot-helpers.R

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,19 +446,28 @@ plot_bg <- function(on = TRUE, ...) {
446446

447447
#' @rdname bayesplot-helpers
448448
#' @export
449-
#' @param color,size Passed to [ggplot2::element_line()].
450-
#'
451-
grid_lines <- function(color = "gray50", size = 0.2) {
449+
#' @param color,linewidth Passed to [ggplot2::element_line()].
450+
#' @param size `r lifecycle::badge("deprecated")` Use `linewidth` instead.
451+
#'
452+
grid_lines <- function(color = "gray50", linewidth = 0.2, size = deprecated()) {
453+
if (lifecycle::is_present(size)) {
454+
lifecycle::deprecate_warn(
455+
"1.16.0",
456+
"grid_lines(size)",
457+
"grid_lines(linewidth)"
458+
)
459+
linewidth <- size
460+
}
452461
theme(
453-
panel.grid.major = element_line(color = color, linewidth = size),
454-
panel.grid.minor = element_line(color = color, linewidth = size * 0.5)
462+
panel.grid.major = element_line(color = color, linewidth = linewidth),
463+
panel.grid.minor = element_line(color = color, linewidth = linewidth * 0.5)
455464
)
456465
}
457466

458-
grid_lines_y <- function(color = "gray50", size = 0.2) {
467+
grid_lines_y <- function(color = "gray50", linewidth = 0.2) {
459468
theme(
460-
panel.grid.major.y = element_line(color = color, linewidth = size),
461-
panel.grid.minor.y = element_line(color = color, linewidth = size * 0.5)
469+
panel.grid.major.y = element_line(color = color, linewidth = linewidth),
470+
panel.grid.minor.y = element_line(color = color, linewidth = linewidth * 0.5)
462471
)
463472
}
464473

R/bayesplot-package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#'
66
#' @import ggplot2 stats rlang
77
#' @importFrom dplyr %>% summarise group_by select
8+
#' @importFrom lifecycle deprecated deprecate_warn is_present
89
#'
910
#' @description
1011
#' \if{html}{

R/helpers-gg.R

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,10 @@ geom_ignore <- function(...) {
2424

2525
#' Add new aesthetic mappings to a list of aesthetic mappings
2626
#'
27-
#' @param mapping a list of `uneval` aesthetic mappings (created by `aes_()`)
28-
#' @param ... additional mappings to add, e.g., `color = ~ parameter`
27+
#' @param mapping a list of `uneval` aesthetic mappings (created by `aes()`)
28+
#' @param ... additional mappings to add using `.data$` syntax
2929
#' @return the updated list
3030
#' @noRd
31-
modify_aes_ <- function(mapping, ...) {
32-
utils::modifyList(mapping, aes_(...))
33-
}
34-
35-
#' Same as `modify_aes_` but using `aes()` instead of `aes_()` (now deprecated).
36-
#' Often `...` will need to contain expression of the form `.data$x` to avoid R cmd check warnings
37-
#' @noRd
3831
modify_aes <- function(mapping, ...) {
3932
utils::modifyList(mapping, aes(...))
4033
}

R/mcmc-diagnostics.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
#'
1919
#' @section Plot Descriptions:
2020
#' \describe{
21+
#' \item{`mcmc_rhat_data()`, `mcmc_neff_data()`}{
22+
#' Data-preparation back ends for the R-hat and effective sample size plots.
23+
#' Users can call these functions directly to obtain the data frame of
24+
#' diagnostic values with rating labels and create custom diagnostic
25+
#' visualizations with **ggplot2**.
26+
#' }
27+
#'
2128
#' \item{`mcmc_rhat()`, `mcmc_rhat_hist()`}{
2229
#' Rhat values as either points or a histogram. Values are colored using
2330
#' different shades (lighter is better). The chosen thresholds are somewhat
@@ -70,7 +77,7 @@
7077
#' (p <- mcmc_acf_bar(x, pars = c("alpha", "beta[1]")))
7178
#'
7279
#' # add horiztonal dashed line at 0.5
73-
#' p + hline_at(0.5, linetype = 2, size = 0.15, color = "gray")
80+
#' p + hline_at(0.5, linetype = 2, linewidth = 0.15, color = "gray")
7481
#' }
7582
#'
7683
#' # fake rhat values to use for demonstration

0 commit comments

Comments
 (0)