View source: R/scaling_general.R
mp_scale | R Documentation |
Since scaling functions such as scale_weighted
only apply to
data.frames with code percentages, the function mp_scale
makes them
applies them to a ManifestoCorpus
or ManifestoDocument
.
mp_scale(
data,
scalingfun = rile,
scalingname = as.character(substitute(scalingfun)),
recode_v5_to_v4 = (scalingname %in% c("rile", "logit_rile")),
...
)
document_scaling(
scalingfun,
returndf = FALSE,
scalingname = "scaling",
recode_v5_to_v4 = FALSE,
...
)
corpus_scaling(
scalingfun,
scalingname = "scaling",
recode_v5_to_v4 = FALSE,
...
)
data |
|
scalingfun |
a scaling function, i.e. a function that takes a data.frame with
category percentages and returns scaled positions, e.g. |
scalingname |
the name of the scale which will be used as a column name when a data.frame is produced |
recode_v5_to_v4 |
recode handbook version 5 scheme to version 4 before scaling; this parameter is only relevant if data is a ManifestoDocument or ManifestoCorpus, but not for data.frames with code percentages |
... |
further arguments passed on to the scaling function |
returndf |
if this flag is TRUE, a data.frame with category percentage values, scaling result and, if available party and date is returned by the returned function |
scale
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.