score_implode | R Documentation |
Converts a sequence of classified scores into a numeric sequence, by imploding the values included in the intervals.
score_implode(x, fn = mean, out.names = names(x))
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 |
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.
score_explode
, score_rollup
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.