Description Details Public fields Methods
R6 class of tweet analyzing process
R6 class of tweet analyzing process
R6 object to encapsulate the reading/cleaning/export of tweets
data
Pulled tweets in tibble. This is subject to change, every time a set of tweets are pulled.
lexicons
A list of tibbles containing lexicons. It is NULL by default, but is given the list at initialization
adjust_negation
If "yes", do adjust bi-gram adjustment.
negation_words
Negation words used for bi-gram adjustments.
stop_words
A tibble of stop words that are irrelevant from analysis. Dataset from tidytext is passed, during initialize.
analysis_result
A list of two tibbles and a ggplot plot, that contain the result of text analysis, performed by self$analyze()
add_negation_word()
Add word to negation_words (lower case). Throw a warning if the word already exists.
TweetAnalysis$add_negation_word(word)
word
Negation word
remove_negation_word()
Remove word from negation_words (lower case). Throw a warning if the word doesn't exists.
TweetAnalysis$remove_negation_word(word)
word
Negation word
add_stop_word()
Add word from stop_words (lower case). Throw a warning if the word already exists.
TweetAnalysis$add_stop_word(word)
word
Stop word
remove_stop_word()
Remove word from stop_words (lower case). Throw a warning if the word doesn't exists.
TweetAnalysis$remove_stop_word(word)
word
Stop word
analyze()
Conduct sentiment analysis. It calls conduct_analysis
using arguments:
self$data
self$lexicons
self$stop_words
self$negation_words
self$adjust_negation
Which returns a list of tibbles. This list is fed to
produce_analysis_output
to produce final outputs, and are saved into
self$analysis_result
TweetAnalysis$analyze()
print_analysis()
Prints out key information about the analysis, as a vector of characters including html br tag.
# of tweets
Overall sentiment
Average sentiment per tweet
TweetAnalysis$print_analysis()
new()
Generate a new class. It requires the stop_words internal data.
TweetAnalysis$new(stop_words)
stop_words
stop_words internal data.
clone()
The objects of this class are cloneable with this method.
TweetAnalysis$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.