Learn R Programming

manifestoR (version 1.5.0)

mp_scale: Scaling annotated manifesto documents

Description

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.

Usage

mp_scale(
  data,
  scalingfun = rile,
  scalingname = as.character(substitute(scalingfun)),
  recode_v5_to_v4 = (scalingname == "rile"),
  ...
)

document_scaling( scalingfun, returndf = FALSE, scalingname = "scaling", recode_v5_to_v4 = FALSE, ... )

corpus_scaling(scalingfun, scalingname = "scaling", ...)

Arguments

data

ManifestoDocument or ManifestoCorpus with coding annotations or a data.frame with category percentages

scalingfun

a scaling function, i.e. a function that takes a data.frame with category percentages and returns scaled positions, e.g. scale_weighted.

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 scalingfun, or count_codes

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

See Also

scale