Description Usage Arguments Value Author(s) Examples
View source: R/sentomeasures_methods.R
Differences the sentiment measures from a sento_measures
object.
1 2 |
x |
a |
lag |
a |
differences |
a |
... |
not used. |
A modified sento_measures
object, with the measures replaced by the differenced measures as well as updated
statistics.
Samuel Borms
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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(howTime = c("equal_weight", "linear"), by = "year", lag = 3)
sento_measures <- sento_measures(corpusSample, l, ctr)
# first-order difference sentiment measures with a lag of two
diffed <- diff(sento_measures, lag = 2, differences = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.