Skip to contents

This function computes the *average absolute deviation* for each column vector in the input matrix x.

Usage

colAADs(x, center, rows = NULL, na.rm = T, ...)

Arguments

x

a numerical matrix features-by-samples

center

numerical value, the central point

rows

(optional) numerical vector giving the rows in x or character vector matching the row names in x to operate over. If missing or rows = NULL, all the rows in x are considered for the computation of the measures

na.rm

logical, whether to remove NA values from x before computation

...

further arguments to colMeans2

Value

A numerical vector containing the computed score for each column in x.

Author

Alessandro Barberis

Examples

x = cbind(c(2,2,3,4,14), c(2,2,3,4,14))
colAADs(x)#2.8 2.8
#> [1] 2.8 2.8