has_pattern | R Documentation |
Indicates if a string has a given pattern.
has_pattern(x, pattern)
Logical. 'TRUE' indicates the string has a given pattern, 'FALSE' otherwise.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.