首页 > 解决方案 > R中未发现对象“负”错误-情绪分析期间

问题描述

我正在尝试通过提取推文在 R 中进行情感分析。推文被提取得很好。但是当我尝试对推文进行标记时出现此错误。我得到的错误是

“mutate_impl(.data,dots)中的错误:评估错误:找不到对象'负'。”。

这是我写的代码

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)

一旦我包含了 Mutate 语句,就会抛出这个错误。感谢我在解决这个问题上能得到的任何帮助。

标签: rsentiment-analysisdplyr

解决方案


推荐阅读