This function takes a character vector with regular expressions, a numeric vector with numeric indices, or a logical vector that is either as long as the source or has length 1; and then always returns a logical vector of the same length as the source.
get_source_filter(
source,
filter,
ignore.case = TRUE,
invert = FALSE,
perl = TRUE,
...
)
A logical vector of the same length as the source.
The source to produce the filter for.
THe filtering criterion: a character vector with regular expressions, a numeric vector with numeric indices, or a logical vector that is either as long as the source or has length 1.
Whether to apply the regular expression case sensitively
or not (see base::grepl()
).
Whether to invert the result or not (i.e. whether the filter
specifies what you want to select (invert=FALSE
) or what you don't want
to select (invert=TRUE
)).
Whether the regular expression (if filter
is a character
vector) is a perl regular expression or not (see base::grepl()
).
Any additional arguments are passed on to base::grepl()
.