powered by
string
pattern
str_count(string, pattern)
regex
fixed
regexpr
str_locate/str_locate_all to locate position of matches
str_locate
str_locate_all
fruit <- c("apple", "banana", "pear", "pineapple") str_count(fruit, "a") str_count(fruit, "p") str_count(fruit, "e") str_count(fruit, c("a", "b", "p", "p"))
Run the code above in your browser using DataLab