trinker / sentimentr

Dictionary based sentiment analysis that considers valence shifters
Other
427 stars 84 forks source link

Highlight fails with sentiment_by if passing in a vector of characters. #110

Closed sdcharle closed 3 years ago

sdcharle commented 5 years ago

mytext <- c( 'do you like it? It is red. But I hate really bad dogs', 'I am the best friend.', "Do you really like it? I'm not happy" )

ss <- sentiment_by(mytext)

highlight(ss)

gives this:

Error in [.data.table(y, , list(sentiment = attributes(x)["averaging.function"], : attempt to apply non-function

Doing this:

attr(ss, "averaging.function") <- sentimentr::average_downweighted_zero

will make highlight work, but is clunky :/

imanojkumar commented 5 years ago

https://stackoverflow.com/questions/57477146/text-highlighting-using-sentimentr-and-shiny-on-flexdashboard-in-r-is-throwing-e/57480153

My issue still is not resolved...

trinker commented 3 years ago

Hello. I beleieve this is the same issue as https://github.com/trinker/sentimentr/issues/104. Can you try with the development version and see if this persists?