Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/sentomeasures_main.R
Sets up control object for (computation of textual sentiment and) aggregation into textual sentiment measures.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ctr_agg(
howWithin = "proportional",
howDocs = "equal_weight",
howTime = "equal_weight",
do.sentence = FALSE,
do.ignoreZeros = TRUE,
by = "day",
lag = 1,
fill = "zero",
alphaExpDocs = 0.1,
alphasExp = seq(0.1, 0.5, by = 0.1),
do.inverseExp = FALSE,
ordersAlm = 1:3,
do.inverseAlm = TRUE,
aBeta = 1:4,
bBeta = 1:4,
weights = NULL,
tokens = NULL,
nCore = 1
)
|
howWithin |
a single |
howDocs |
a single |
howTime |
a |
do.sentence |
see |
do.ignoreZeros |
a |
by |
a single |
lag |
a single |
fill |
a single |
alphaExpDocs |
a single |
alphasExp |
a |
do.inverseExp |
a |
ordersAlm |
a |
do.inverseAlm |
a |
aBeta |
a |
bBeta |
a |
weights |
optional own weighting scheme(s), used if provided as a |
tokens |
see |
nCore |
see |
For available options on how aggregation can occur (via the howWithin
,
howDocs
and howTime
arguments), inspect get_hows
. The control parameters
associated to howDocs
are used both for aggregation across documents and across sentences.
A list
encapsulating the control parameters.
Samuel Borms, Keven Bluteau
measures_fill
, almons
, compute_sentiment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | set.seed(505)
# simple control function
ctr1 <- ctr_agg(howTime = "linear", by = "year", lag = 3)
# more elaborate control function (particular attention to time weighting schemes)
ctr2 <- ctr_agg(howWithin = "proportionalPol",
howDocs = "exponential",
howTime = c("equal_weight", "linear", "almon", "beta", "exponential", "own"),
do.ignoreZeros = TRUE,
by = "day",
lag = 20,
ordersAlm = 1:3,
do.inverseAlm = TRUE,
alphasExp = c(0.20, 0.50, 0.70, 0.95),
aBeta = c(1, 3),
bBeta = c(1, 3, 4, 7),
weights = data.frame(myWeights = runif(20)),
alphaExp = 0.3)
# set up control function with one linear and two chosen Almon weighting schemes
a <- weights_almon(n = 70, orders = 1:3, do.inverse = TRUE, do.normalize = TRUE)
ctr3 <- ctr_agg(howTime = c("linear", "own"), by = "year", lag = 70,
weights = data.frame(a1 = a[, 1], a2 = a[, 3]),
do.sentence = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.