Skip to content

Commit a62ebff

Browse files
committed
minor cleaning
1 parent 6536ce2 commit a62ebff

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

R/tidy-params.R

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@
1414
#' (`starts_with()`, `contains()`, `num_range()`, etc.) for the same purpose.
1515
#' **bayesplot** also exports some additional helper functions
1616
#' to help with parameter selection:
17-
#' * `param_range()`: like [tidyselect::num_range()] but used when parameter
18-
#' indexes are in brackets (e.g. `beta[2]`).
17+
#' * `param_range()`: like [`num_range()`][tidyselect::num_range] but used
18+
#' when parameter indexes are in brackets (e.g. `beta[2]`).
1919
#' * `param_glue()`: for more complicated parameter names with multiple
2020
#' indexes (including variable names) inside the brackets
2121
#' (e.g., `beta[(Intercept) age_group:3]`).
2222
#'
2323
#' These functions can be used inside of `vars()`, `dplyr::select()`,
24-
#' and similar functions just like the
24+
#' and similar functions, just like the
2525
#' [tidyselect helper functions][tidyselect::select_helpers].
2626
#' See the **Examples** section.
2727
#'
28+
#' @seealso [glue::glue()]
29+
#'
2830
#' @examples
2931
#' x <- example_mcmc_draws(params = 6)
3032
#' dimnames(x)
@@ -117,8 +119,8 @@ param_range <- function(prefix, range, vars = NULL) {
117119
#' @export
118120
#' @param pattern,... For `param_glue()` only, `pattern` is a string containing
119121
#' expressions enclosed in braces and `...` should be named arguments
120-
#' providing one character vector per expression in braces in `patten`.
121-
#' It easiest to describe how to use these arguments with an example:
122+
#' providing one character vector per expression in braces in `patten`. It is
123+
#' easiest to describe how to use these arguments with an example:
122124
#'
123125
#' param_glue("beta_{var}[{level}]",
124126
#' var = c("age", "income"),
@@ -199,7 +201,7 @@ tidyselect_parameters <- function(complete_pars, pars_list) {
199201
pars_list <- lapply(pars_list, rlang::env_bury, !!! helpers)
200202
selected <- tidyselect::vars_select(.vars = complete_pars, !!! pars_list)
201203
if (!length(selected)) {
202-
stop("No parameters were found matching those names.", call. = FALSE)
204+
abort("No parameters were found matching those names.")
203205
}
204206
return(unname(selected))
205207
}

man/tidy-params.Rd

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)