has_pattern: Indicates if a string has a given pattern.

View source: R/has_pattern.R

has_patternR Documentation

Indicates if a string has a given pattern.

Description

Indicates if a string has a given pattern.

Usage

has_pattern(x, pattern)

Value

Logical. 'TRUE' indicates the string has a given pattern, 'FALSE' otherwise.

Examples

library(stringi)

text <- dplyr::as_tibble(c('A designer knows that he has achieved perfection',
'not when there is nothing left to add',
'but when there is nothing left to take away.'))
has_pattern(text, 'nothing')
apply(text, 1, has_pattern, 'nothing')


filipezabala/jurimetrics documentation built on Aug. 27, 2024, 7:07 a.m.