Description Usage Arguments Value Examples
View source: R/get_sentiment_tweets.R
This function computes the sentiment from tweets. Remind to connect with twitter using your API Key.
1 2 3 4 5 6 7 8 9 | get_sentiment_tweets(
ntweets,
time_tweet,
terms_list,
time_zone,
positive_dictionary,
negative_dictionary,
sentiment_index_type
)
|
ntweets |
Number of tweets to be searched |
time_tweet |
Time in hours where the tweets will be filtered |
terms_list |
Terms to be searched |
time_zone |
The time zone |
positive_dictionary |
The list of positive terms of the dictionary |
negative_dictionary |
The list of negative terms of the dictionarya tibble with the words counting |
sentiment_index_type |
The sentiment type to be used according to the dictionary, positive, negative or both. Default is both, positive and negative |
A list with: (1) - the sentiment index, (2) a tibble with the words counting, (3) a tibble with the negative words counting and (4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
#Not run:
ntweets <- 500
time_tweet <- 6
terms_list <- c("IBOVESPA OR bovespa OR ibov OR petroleo OR $SPX OR $SPY OR $EWZ")
time_zone <- "Brazil/East"
positive_dictionary <- my_dictionary[['positive_terms']]
negative_dictionary <- my_dictionary[['negative_terms']]
sentiment_index <- get_sentiment_tweets(ntweets = ntweets,
terms_list = terms_list,
time_tweet = time_tweet,
time_zone = time_zone,
positive_dictionary = positive_dictionary,
negative_dictionary = negative_dictionary
)
sent_idx <- sentiment_index[[1]]
sent_wrd <- sentiment_index[[2]]
sent_pos <- sentiment_index[[3]]
sent_neg <- sentiment_index[[4]]
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.