
Last chance! 50% off unlimited learning
Sale ends in
Detect sentiment in a source text
detect_sentiment(text, language = "en", ...)
A character string containing a text to sentiment analyze, or a character vector to perform analysis separately for each element.
A character string containing a two-letter language code. Currently “en” and “es” are supported.
Additional arguments passed to comprehendHTTP
.
A data frame
# NOT RUN {
# simple example
detect_sentiment("I have never been happier. This is the best day ever.")
txt <-c("I have never been happier. This is the best day ever.",
"I have always been happier. This is the worst day ever.")
detect_sentiment(txt)
# }
Run the code above in your browser using DataLab