|
14 | 14 | #' (`starts_with()`, `contains()`, `num_range()`, etc.) for the same purpose.
|
15 | 15 | #' **bayesplot** also exports some additional helper functions
|
16 | 16 | #' 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]`). |
19 | 19 | #' * `param_glue()`: for more complicated parameter names with multiple
|
20 | 20 | #' indexes (including variable names) inside the brackets
|
21 | 21 | #' (e.g., `beta[(Intercept) age_group:3]`).
|
22 | 22 | #'
|
23 | 23 | #' These functions can be used inside of `vars()`, `dplyr::select()`,
|
24 |
| -#' and similar functions just like the |
| 24 | +#' and similar functions, just like the |
25 | 25 | #' [tidyselect helper functions][tidyselect::select_helpers].
|
26 | 26 | #' See the **Examples** section.
|
27 | 27 | #'
|
| 28 | +#' @seealso [glue::glue()] |
| 29 | +#' |
28 | 30 | #' @examples
|
29 | 31 | #' x <- example_mcmc_draws(params = 6)
|
30 | 32 | #' dimnames(x)
|
@@ -117,8 +119,8 @@ param_range <- function(prefix, range, vars = NULL) {
|
117 | 119 | #' @export
|
118 | 120 | #' @param pattern,... For `param_glue()` only, `pattern` is a string containing
|
119 | 121 | #' 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: |
122 | 124 | #'
|
123 | 125 | #' param_glue("beta_{var}[{level}]",
|
124 | 126 | #' var = c("age", "income"),
|
@@ -199,7 +201,7 @@ tidyselect_parameters <- function(complete_pars, pars_list) {
|
199 | 201 | pars_list <- lapply(pars_list, rlang::env_bury, !!! helpers)
|
200 | 202 | selected <- tidyselect::vars_select(.vars = complete_pars, !!! pars_list)
|
201 | 203 | if (!length(selected)) {
|
202 |
| - stop("No parameters were found matching those names.", call. = FALSE) |
| 204 | + abort("No parameters were found matching those names.") |
203 | 205 | }
|
204 | 206 | return(unname(selected))
|
205 | 207 | }
|
0 commit comments