Learn R Programming

PolitwoopsR (version 1.0)

clean_text: Clean tweet text

Description

Prepares tweets for text analysis by removing usernames (@user), URLs (http://...), new lines, breaks and special symbols. Expands contractions (e.g. "won't" to "will not", "I've" to "I have", etc.).

Usage

clean_text(content)

Arguments

content
A vector of strings (for instance get_pw_tweets()$content)

See Also

get_pw_tweets get_pw_pol merge_pw

Examples

Run this code
## Not run: 
# 
# tweet.df <- get_pw_tweets(1, 5)
# tweet.df$clean <- clean_text(tweet.df$content)
# 
# ## End(Not run)

Run the code above in your browser using DataLab