I want to use str_count from the stringi package to count special symbols in a string.
Something like this:
library(stringi)
data$var1 <- stri_count(data$var, pattern="[[:punct:]]")
I'm getting the following error.
Error in stri_count(data$var, pattern = "[[:punct:]]") :
you have to specify either `regex`, `fixed`, `coll`, or `charclass`
Any ideas?