str_detect {stringr}R Documentation

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

Description

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

Usage

str_detect(string, pattern)

Arguments

string input character vector
pattern pattern to look for. See regex for description.

Value

boolean vector

See Also

grepl which this function wraps

Examples

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

[Package stringr version 0.2 Index]