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()
See also
Other vectorized functions:
get_cumulative_vocabulary(),
get_frequency(),
get_hir(),
get_htr(),
get_idf_by(),
get_match(),
get_tf_by(),
get_tfidf_by(),
get_ttr(),
is_hapax(),
is_new()
Examples
my_values <- c("I", "am", "happy")
get_sentiment(my_values)
#> [1] NA NA "positive"
