trinker / sentimentr

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

highlight issue #104

Closed kenmcgarry closed 5 years ago

kenmcgarry commented 5 years ago

Hi Thanks for this great package.

I've upgraded from sentimentr V2.6.1 to V 2.7.1 and one of the simpler examples I use no longer works. The more complicated examples you provide seem to work fine.

'My life has become terrible since I started work.' %>%
  sentiment_by(by = NULL) %>%
highlight()
Error in `[.data.table`(y, , list(sentiment = attributes(x)[["averaging.function"]](sentiment),  : 
  attempt to apply non-function 
trinker commented 5 years ago

Thank you kindly for reporting. I can replicate. I'm guessing something simple.

trinker commented 5 years ago

@kenmcgarry Thanks for the feedback. Fixed now. Give it a try.

kenmcgarry commented 5 years ago

Thanks, will do.

Ken

From: Tyler Rinker [mailto:notifications@github.com] Sent: 11 April 2019 21:24 To: trinker/sentimentr Cc: Kenneth McGarry; Mention Subject: [EXT] Re: [trinker/sentimentr] highlight issue (#104)

@kenmcgarryhttps://github.com/kenmcgarry Thanks for the feedback. Fixed now. Give it a try.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/trinker/sentimentr/issues/104#issuecomment-482297312, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALBc3sYaW9euQGsnnaS1M1qjevgT0e4jks5vf5nKgaJpZM4cMTRG.

zong-you commented 5 years ago

Hi, I am using sentimentr V2.7.1 and am experiencing the same error as Ken when I use read.csv.

mytext <- c(
'do you like it? But I hate really bad dogs',
'I am the best friend.',
'Do you really like it? I'm not a fan'
)
write.csv(mytext, "mytext.csv")

mytext2 <- read.csv("mytext.csv")
mytext2 %>%
get_sentences() %>%
sentiment_by() %>%
highlight()
Error in [.data.table(y, , list(sentiment = attributes(x)["averaging.function"], :
attempt to apply non-function
trinker commented 5 years ago

You need 2.8.0

zong-you commented 5 years ago

Yes version 2.8.0 does not have this issue. Thanks for your reply.

For the benefit of other users, you can download the latest version from Github using the following code: install_github("trinker/sentimentr")