#' @export
nchar_punct <-
function(vector, punct = NULL) {
if (is.null(punct)) {
nchar(gsub("[^[:punct:]]", "", as.character(vector)))
} else {
x <- stringr::str_remove_all(vector,
pattern = paste0("[^[", punct, "]]"))
nchar(x)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.