detect: Detect the presence or absence of a pattern in a string.

Description Usage Arguments Examples

Description

Detect the presence or absence of a pattern in a string.

Usage

1

Arguments

x

A character vector to look for the patterns in.

pattern

A pattern to look for.

Examples

1
2
3
4
5
6
7
8
### These examples are taken from stringr's doc (?str_detect) ###

fruit <- c("apple", "banana", "pear", "pinapple")
rr4r_detect(fruit, "a")
rr4r_detect(fruit, "^a")
rr4r_detect(fruit, "a$")
rr4r_detect(fruit, "b")
rr4r_detect(fruit, "[aeiou]")

yutannihilation/rr4r documentation built on April 16, 2021, 8:40 a.m.