Compares against the regex group [[:punct:]]
.
Arguments
- x
A vector of characters.
Value
A boolean vector indicating whether each element of x
is
considered as punctuation.
Examples
is_punct(chars("I can haz?"))
#> I c a n h a z ?
#> FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
Filter(Negate(is_punct), chars("abc,123;$*%?"))
#> [1] "abc123"