I have recently started training myself into sentiment analysis.I have a dataset that looks like this:initial data
The original data consisted of reviews of wines, one per each row. What I have done is tokenize it and performed basic sentiment analysis with one of the R lexicons. As can bee seen in the screentshot. Column X refers to the original row in the initial data frame. What I want to do now is calculate the net effect( to see which is the prevailing for each row- positive or negative, however in numbers for each original row(X) and attach it as a column). I have tried with the following code but it does not work:
per_row <- unigrams_all_ns %>%
inner_join(get_sentiments("bing"),by=c("unigram"="word"))%>%
group_by(X)%>%
spread(sentiment, n, fill = 0)
I get the following error
Error: var
must evaluate to a single number or a column name, not a function