Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/sentomeasures_main.R
Wrapper function which assembles calls to compute_sentiment
and aggregate
.
Serves as the most direct way towards a panel of textual sentiment measures as a sento_measures
object.
1 | sento_measures(sento_corpus, lexicons, ctr)
|
sento_corpus |
a |
lexicons |
a |
ctr |
output from a |
As a general rule, neither the names of the features, lexicons or time weighting schemes may contain any ‘-’ symbol.
A sento_measures
object, which is a list
containing:
measures |
a |
features |
a |
lexicons |
a |
time |
a |
stats |
a |
sentiment |
the document-level sentiment scores |
attribWeights |
a |
ctr |
a |
Samuel Borms, Keven Bluteau
compute_sentiment
, aggregate
, measures_update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data("usnews", package = "sentometrics")
data("list_lexicons", package = "sentometrics")
data("list_valence_shifters", package = "sentometrics")
# construct a sento_measures object to start with
corpus <- sento_corpus(corpusdf = usnews)
corpusSample <- quanteda::corpus_sample(corpus, size = 500)
l <- sento_lexicons(list_lexicons[c("LM_en", "HENRY_en")], list_valence_shifters[["en"]])
ctr <- ctr_agg(howWithin = "counts",
howDocs = "proportional",
howTime = c("equal_weight", "linear", "almon"),
by = "month",
lag = 3,
ordersAlm = 1:3,
do.inverseAlm = TRUE)
sento_measures <- sento_measures(corpusSample, l, ctr)
summary(sento_measures)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.