0

I am trying to do Sentiment Analysis in R by extracting the Tweets. Tweets are getting extracted fine. But getting this error when I try to Tokenize the tweets. Error I get is

"Error in mutate_impl(.data, dots) : Evaluation error: object 'negative' not found.".

This is the code I have written

tokens %>%
  inner_join(get_sentiments("bing")) %>% # pull out only sentiment words
  count(sentiment) %>% # count the # of positive & negative words
  spread(sentiment, n, fill = 0) %>%
  mutate(sentiment = positive - negative)

This error is getting thrown once I include the Mutate statement. Appreciate any help I can get in resolving this please.

A. Suliman
  • 11,665
  • 5
  • 16
  • 31
  • Please, can you copy_past `tokens %>% inner_join(get_sentiments("bing")) %>% # pull out only sentiment words count(sentiment) %>% # count the # of positive & negative words spread(sentiment, n, fill = 0) %>% str()` – A. Suliman Aug 26 '18 at 12:34
  • Thanks Suliman - See this shows the same information I was trying to get by applying mutate statement. – Ashwin Kumar Aug 26 '18 at 13:05
  • I have the same error. Did someone fix this? Probably this is because some of my texts are so short that no negative words exists but none of checks if negative exists work... – jake-ferguson Jan 15 '19 at 10:16

0 Answers0