Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight() not using the supplied averaging function from sentiment_by() #103

Closed
trinker opened this issue Mar 20, 2019 · 0 comments
Closed

Comments

@trinker
Copy link
Owner

trinker commented Mar 20, 2019

Reported by Kelvin Lam Lamkel@outlook.com

FIrst of all, thank you for the great sentimentr package. I am using it currently for a POC and it's going great so far.

I have a question about highlight(). I am using average_downweighted_zero for sentiment_by, and the output data frame looks good. However, the highlight() seems to be using the mean instead, and I found the avg sentiments aren't matching those in the highlighted html whenever there's zero sentiment score.

MWE

library(magrittr)
library(dplyr)

hu_liu_cannon_reviews %>%
    filter(review_id %in% sample(unique(review_id), 3)) %>%
    mutate(review = get_sentences(text)) %$%
    sentiment_by(review, review_id) 

hu_liu_cannon_reviews %>%
    filter(review_id %in% sample(unique(review_id), 3)) %>%
    mutate(review = get_sentences(text)) %$%
    sentiment_by(review, review_id) %>%
    highlight()
trinker pushed a commit that referenced this issue Mar 20, 2019
… the

  `averaging.function` argument supplied to `sentiment_by()`.  THis behavior has
  been corrected.  Spotted thanks to Kelvin Lam (see #103).
@trinker trinker closed this as completed Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant