mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-16 17:42:10 +01:00
533 B
533 B
Matches pattern to vector based on match type
Matches pattern to vector based on match type
Usage
grepl_fix(data, pattern, type = c("prefix", "infix", "suffix"))
Arguments
-
data:
vector
-
pattern:
pattern(s) to match. Character vector of length 1 or more.
-
type:
type of match. can be one of "prefix","infix" or "suffix".
Value
logical vector
Examples
c("id", "age", "weight_0", "weight_1") |> grepl_fix(pattern = c("_0", "_1"), type = "suffix")
#> [1] FALSE FALSE TRUE TRUE