get_sentiment_tweets {TwitterAutomatedTrading} | R Documentation |
get_sentiment_tweets
Description
This function computes the sentiment from tweets. Remind to connect with twitter using your API Key.
Usage
get_sentiment_tweets(
ntweets,
time_tweet,
terms_list,
time_zone,
positive_dictionary,
negative_dictionary,
sentiment_index_type
)
Arguments
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 |
Value
A list with: (1) - the sentiment index, (2) a tibble with the words counting, (3) a tibble with the negative words counting and (4
Examples
## 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)
[Package TwitterAutomatedTrading version 0.1.0 Index]