Skip to contents

Compares against the regex group [[:punct:]].

Usage

is_punct(x)

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"