remove_punct: Remove all punctuation and special characters from the input...

Description Usage Arguments Value Examples

View source: R/remove_punct.R

Description

Remove all punctuation and special characters from the input tweets data

Usage

1
remove_punct(tweets, skip = NULL)

Arguments

tweets

A vector of tweets

skip

Vector of charcters or NULL. The set of characters that do not have to be removed. Default is NULL. If NULL, all characters except alphabets, numbers and space would be removed.

Value

Vector of tweets without special characters

Examples

1
2
3
4
5
6
tweets <- c(
   "Make America Great Again! @DonaldTrump",
    "It's rocket-science tier investment~~ #LoveElonMusk"
)
remove_punct(tweets)
remove_punct(tweets, skip = c("'", "@", "#", "-"))

UBC-MDS/textprepr documentation built on Feb. 5, 2022, 8:13 a.m.