score_explode: Score explosion

View source: R/norming.R

score_explodeR Documentation

Score explosion

Description

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

Usage

score_explode(x, sep = "-", out.names = names(x))

Arguments

x

Numeric vector.

sep

Symbol used to separate the extremes of an interval.

out.names

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

Details

For each interval of scores, the resulting vector will contain all the numbers included within te extremes (see the examples for details). Pay attention that the length of the output vector can be different to the length of the input vector.

See Also

score_implode, score_rollup

Examples

# Example of interval explosion:
score_explode("1-3")
score_explode("3-1")
# Examples of explosion of scores:
x <- c("19","17-18","","16","15","","14","11-13","10",
       "9","8","","","7","6","5","4","","3","1-2")
       cbind(x)
score_explode(x)
x <- c("18-20","21-24","25","26-28")
cbind(x)
score_explode(x)
x <- rev(x)
cbind(x)
score_explode(x)

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