remove_punct.Rd
Remove all punctuation and special characters from the input tweets data
remove_punct(tweets, skip = NULL)
A vector of tweets
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.
Vector of tweets without special characters
tweets <- c(
"Make America Great Again! @DonaldTrump",
"It's rocket-science tier investment~~ #LoveElonMusk"
)
remove_punct(tweets)
#> [1] "Make America Great Again DonaldTrump"
#> [2] "Its rocketscience tier investment LoveElonMusk"
remove_punct(tweets, skip = c("'", "@", "#", "-"))
#> [1] "Make America Great Again @DonaldTrump"
#> [2] "It's rocket-science tier investment #LoveElonMusk"