score_implode: Score implosion

View source: R/norming.R

score_implodeR Documentation

Score implosion

Description

Converts a sequence of classified scores into a numeric sequence, by imploding the values included in the intervals.

Usage

score_implode(x, fn = mean, out.names = names(x))

Arguments

x

Numeric vector.

fn

Method to identify the representative value of intervals. Default is the mean between extremes.

out.names

Names for the elements in the output vector (use NULL to exclude names).

Details

For each interval of scores, the function finds a representative number for the values included within the extremes (see the examples for details). Customised functions can be used to extract the representative values for intervals.

See Also

score_explode, score_rollup

Examples

x <- data.frame(
        class=c("19","17-18","","16","15","","14","11-13","10",
                "9","8","","","7","6","5","4","","3","1-2"),
        stringsAsFactors=FALSE
    )
x$implosion <- score_implode(x$class)
x

DavideMassidda/testing documentation built on Oct. 12, 2023, 4:32 p.m.