Skip to content

Commit ea1ca27

Browse files
committed
minor cleaning
[ci skip]
1 parent c3c841f commit ea1ca27

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

R/helpers-shared.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ suggested_package <- function(pkg, min_version = NULL) {
3333
#' @param explicit Character vector of selected parameter names.
3434
#' @param patterns Character vector of regular expressions.
3535
#' @param complete Character vector of all possible parameter names.
36-
#' @return Characeter vector of combined explicit and matched (via regex)
36+
#' @return Character vector of combined explicit and matched (via regex)
3737
#' parameter names, unless an error is thrown.
3838
#'
3939
select_parameters <-
@@ -45,15 +45,17 @@ select_parameters <-
4545
is.character(patterns),
4646
is.character(complete))
4747

48-
if (!length(explicit) && !length(patterns))
48+
if (!length(explicit) && !length(patterns)) {
4949
return(complete)
50+
}
5051

5152
if (length(explicit)) {
5253
if (!all(explicit %in% complete)) {
5354
not_found <- which(!explicit %in% complete)
5455
stop(
5556
"Some 'pars' don't match parameter names: ",
56-
paste(explicit[not_found], collapse = ", ")
57+
paste(explicit[not_found], collapse = ", "),
58+
call. = FALSE
5759
)
5860
}
5961
}
@@ -65,8 +67,10 @@ select_parameters <-
6567
unlist(lapply(seq_along(patterns), function(j) {
6668
grep(patterns[j], complete, value = TRUE)
6769
}))
68-
if (!length(regex_pars))
70+
71+
if (!length(regex_pars)) {
6972
stop("No matches for 'regex_pars'.", call. = FALSE)
73+
}
7074
}
7175

7276
unique(c(explicit, regex_pars))

0 commit comments

Comments
 (0)