get_sentiments
From tidytext v0.3.0
by Julia Silge
Get a tidy data frame of a single sentiment lexicon
Get specific sentiment lexicons in a tidy format, with one row per word,
in a form that can be joined with a one-word-per-row dataset.
The "bing"
option comes from the included sentiments
data frame, and others call the relevant function in the textdata
package.
Usage
get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))
Arguments
- lexicon
The sentiment lexicon to retrieve; either "afinn", "bing", "nrc", or "loughran"
Value
A tbl_df with a word
column, and either a sentiment
column (if lexicon
is not "afinn") or a numeric value
column
(if lexicon
is "afinn").
Examples
# NOT RUN {
library(dplyr)
get_sentiments("bing")
# }
# NOT RUN {
get_sentiments("afinn")
get_sentiments("nrc")
# }
# NOT RUN {
# }
Community examples
Looks like there are no examples yet.