case-insensitive grep, returning values
vigrep(..., value = TRUE, ignore.case = TRUE)
parameters sent to base::grep()
vector of matching values
This function is a simple wrapper around base::grep()
which
runs in case-insensitive mode, and returns matching values. It is
particularly helpful when grabbing values from a vector.
V <- paste0(LETTERS[1:5], LETTERS[4:8]);
vigrep("d", V);
#> [1] "AD" "DG"