Description Usage Arguments Value Examples
happyorsad sentiment-scores a string of text. It uses the AFINN sentiment scoring. It assigns a value to each recognized word or emoticon in the string and returns the sum.
1 | happyorsad(string, language = "da")
|
string: |
a text string |
language: |
"en" for english, "da" for danish, "emoticon" for emoticons. |
The function returns the sum of sentiment.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Examples of sentiment scoring
library(happyorsad)
# Score danish words
string_da <- 'Hvis ikke det er det mest afskyelige elendige flueknepperi...'
happyorsad(string_da, "da")
# Score english words
string_en <- 'This is utterly excellent!'
happyorsad(string_en, "en")
# Score emoticons
string_emoticon <- 'I saw that yesterday :)'
happyorsad(string_emoticon, "emoticon")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.