Skip to contents

This function computes a statistical measure from an input vector. It is an internal function, and it is not intended to be called by users.

Usage

computeVectorMeasure(
  x,
  i = NULL,
  score = c("sum", "weightedSum", "mean", "trimmedMean", "weightedMean", "median",
    "mode", "midrange", "midhinge", "trimean", "iqm", "iqr", "mad", "aad", "ssgsea",
    "gsva", "plage", "zscore"),
  na.rm = TRUE,
  ...
)

Arguments

x

(named) numerical vector

i

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

score

character string indicating the statistical measure to compute

na.rm

logical, whether to remove NA values from x before computation

...

further arguments to score

Value

A numerical value representing the computed measure. A default NA value is returned if the score can't be computed.

Author

Alessandro Barberis