@@ -33,7 +33,7 @@ suggested_package <- function(pkg, min_version = NULL) {
33
33
# ' @param explicit Character vector of selected parameter names.
34
34
# ' @param patterns Character vector of regular expressions.
35
35
# ' @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)
37
37
# ' parameter names, unless an error is thrown.
38
38
# '
39
39
select_parameters <-
@@ -45,15 +45,17 @@ select_parameters <-
45
45
is.character(patterns ),
46
46
is.character(complete ))
47
47
48
- if (! length(explicit ) && ! length(patterns ))
48
+ if (! length(explicit ) && ! length(patterns )) {
49
49
return (complete )
50
+ }
50
51
51
52
if (length(explicit )) {
52
53
if (! all(explicit %in% complete )) {
53
54
not_found <- which(! explicit %in% complete )
54
55
stop(
55
56
" Some 'pars' don't match parameter names: " ,
56
- paste(explicit [not_found ], collapse = " , " )
57
+ paste(explicit [not_found ], collapse = " , " ),
58
+ call. = FALSE
57
59
)
58
60
}
59
61
}
@@ -65,8 +67,10 @@ select_parameters <-
65
67
unlist(lapply(seq_along(patterns ), function (j ) {
66
68
grep(patterns [j ], complete , value = TRUE )
67
69
}))
68
- if (! length(regex_pars ))
70
+
71
+ if (! length(regex_pars )) {
69
72
stop(" No matches for 'regex_pars'." , call. = FALSE )
73
+ }
70
74
}
71
75
72
76
unique(c(explicit , regex_pars ))
0 commit comments