Skip to content

Commit

Permalink
add stat_slab2() and fix check()
Browse files Browse the repository at this point in the history
  • Loading branch information
venpopov committed Apr 7, 2024
1 parent 21e67ad commit 21fe2ee
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export(sdm)
export(sdmSimple)
export(softmax)
export(softmaxinv)
export(stat_slab2)
export(supported_models)
export(theme_dist)
export(use_model_template)
Expand Down
18 changes: 18 additions & 0 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,21 @@ theme_dist <- function() {
axis.title.y = element_blank())
}


#' ggdist::stat_slab() with nice defaults
#'
#' A wrapper for ggdist::stat_slab() that sets default subguides and scales to
#' display the density on the y axis.
#' @param ... Additional arguments passed to ggdist::stat_slab()
#' @inheritParams ggdist::geom_slab
#' @return a stat_slab() object
#' @keywords plot
#' @export
stat_slab2 <- function(...,
subguide = subguide_outside(title = "density"),
subscale = subscale_thickness(expand = expansion(c(0, 0.05))),
normalize = 'groups') {

stat_slab(..., subguide = subguide, subscale = subscale, normalize = normalize)
}

2 changes: 1 addition & 1 deletion man/plot-distribution.Rd

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

69 changes: 69 additions & 0 deletions man/stat_slab2.Rd

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

0 comments on commit 21fe2ee

Please sign in to comment.