Skip to contents

This scorer returns the *midrange* score(s). See the **Details** section below for further information.

Usage

midrangeScorer(
  x,
  i = NULL,
  na.rm = TRUE,
  transform.fun = NULL,
  transform.args = list(),
  transform.sub = F
)

Arguments

x

a numerical matrix features-by-samples

i

(optional) numerical vector giving the (row) position in x or character vector matching the (row) names in x. If missing or i = NULL, the entire x is considered for the computation of the score

na.rm

logical, whether to remove NA values from x before computation

transform.fun

function to transform the data. If provided, x is transformed (x = transform.fun(x, transform.args)) before the computation of the scores. See getDataTransformer for further details about built-in options

transform.args

list of parameters to the data transformation function

transform.sub

logical, whether to transform x after it is subset for i (used to speedup computation). Default is FALSE, meaning the transformation would be applied directly to x provided in input

Value

A numerical value representing the computed score. A default NA value is returned if the score can't be computed, or if i values are not present in x.

Details

The midrange score is the average of the lowest and highest values in a set of data. It is a measure of central tendency like the mean, median, and mode. However, it is more prone to bias than these other measures because it relies solely upon the two most extreme scores, which could potentially be outliers.

This function calculates the range of values in each column of x by calling colRanges. Then, it uses the min and max values to compute the score.

See also

Author

Alessandro Barberis