remove_punctuation: Faster Punctuation Removal Courtesy of 'stringr'

Description Usage Arguments Value Examples

View source: R/remove_punctuation.R

Description

Uses stringr's str_replace_all to remove punctuation.

Usage

1
remove_punctuation(x, punct_pattern = "[^\\w ]|_")

Arguments

x

A character vector.

punct_pattern

Regular expression pattern to match for punctuation. Defaults to "[^\w ]|_", which matches any character that is not alphanumeric or a space, including underscores.

Value

A character vector with punctuation removed.

Examples

1
2
docs <- c("What are you doing down there, crashy?", "I'm real good at lying to Lois.")
docs <- remove_punctuation(docs)

dtburk/texanaaid documentation built on Nov. 12, 2019, 9:44 p.m.