measures_update: Update sentiment measures

Description Usage Arguments Value Author(s) See Also Examples

View source: R/sentomeasures_measures_xyz.R

Description

Updates a sento_measures object based on a new sento_corpus provided. Sentiment for the unseen corpus texts calculated and aggregated applying the control variables from the input sento_measures object.

Usage

1

Arguments

sento_measures

sento_measures object created with sento_measures

sento_corpus

a sento_corpus object created with sento_corpus.

lexicons

a sento_lexicons object created with sento_lexicons.

Value

An updated sento_measures object.

Author(s)

Jeroen Van Pelt, Samuel Borms, Andres Algaba

See Also

sento_measures, compute_sentiment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("usnews", package = "sentometrics")

corpus1 <- sento_corpus(usnews[1:500, ])
corpus2 <- sento_corpus(usnews[400:2000, ])

ctr <- ctr_agg(howTime = "linear", by = "year", lag = 3)
l <- sento_lexicons(list_lexicons[c("LM_en", "HENRY_en")],
                    list_valence_shifters[["en"]])
sento_measures <- sento_measures(corpus1, l, ctr)
sento_measuresNew <- measures_update(sento_measures, corpus2, l)

sentometrics documentation built on Aug. 18, 2021, 9:06 a.m.