Is there an stringr equivalent to base R's grep
function?
I want to have the index of the string that matches. Example:
grep("F|Y", LETTERS)
[1] 6 25
With stringr my workaround would be using which
as follows:
which(str_detect(LETTERS, "F|Y"))
[1] 6 25