sentiment: Returns a scalar estimate of the sentiment of the text

Description Usage Arguments Value See Also Examples

Description

Given input text, returns a scalar estimate of the sentiment of that text.

Usage

1
sentiment(text, local.api = FALSE)

Arguments

text

text for analysis

local.api

logical, whether use local or remote API

Value

Numerical value roughly in the range from 0 to 1 with 0.5 indicating neutral sentiment. For reference, 0 suggests very negative sentiment and 1 suggests very positive sentiment.

See Also

political, language

Examples

1
2
3
4
5
emotion <- sentiment("Thanks everyone for the birthday wishes!!
                      It was a crazy few days ><")
emotion
cat(sprintf("This text has %s tonality",
             ifelse(emotion > 0.5, "positive", "negative")))

redmode/indicoio documentation built on May 27, 2019, 4:03 a.m.