Skip to contents

Get sentiment matches of values in a vector

Usage

get_sentiment(
  x,
  lexicon = c("bing", "afinn", "loughran", "nrc", "nrc_eil", "nrc_vad"),
  ...
)

Arguments

x

A vector, such as a column of character strings

lexicon

The sentiment lexicon to use from the tidytext package. Options include "bing", "afinn", "loughran", "nrc", "nrc_eil", or "nrc_vad".

...

Additional values passed to get_match()

Value

A vector or nested list of sentiments for each value of x.

See also

Examples

my_values <- c("I", "am", "happy")

get_sentiment(my_values)
#> [1] NA         NA         "positive"