knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width=6, fig.height=4 )
tweetr
is a R package for text analysis and sentiment analysis on
tweets. The package will allow you to extract tweets from Twitter,
visualize user habit on tweet posting, and apply sentiment analysis to
the data.
To use this package, follow the installation guide on README and install this package. Then, import the package.
library(tweetr)
Download tweet data with get_tweets
:
.Renviron
file in the
root directory. tweetr
package, you have install the test data, which contains
500 tweets from @BrunoMars. You don't have to create a credential
to test the other functions in this package.```r data <- get_tweets('@BrunoMars', n_tweets=100)
data
```
Timeline analysis with plot_timeline
:
r
data <- tweetr::brunomars_tweet
plot_timeline(data, time)
plot_hashtags
:
r
data <- tweetr::brunomars_tweet
plot_hashtags(data)
sentiment_analysis
:
r
data <- tweetr::brunomars_tweet
sentiment <- sentiment_analysis(data)
sentiment
visualize_sentiment
:
r
data <- tweetr::brunomars_tweet
sentiment <- sentiment_analysis(data)
visualize_sentiments(sentiment)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.