Mad: Column and row-wise mean absolute deviations

View source: R/mad2.R

Column and rows-wise mean absolute deviationsR Documentation

Column and row-wise mean absolute deviations

Description

Column and row-wise mean absolute deviations.

Usage

colMads(x,method = "median",na.rm=FALSE,parallel = FALSE, cores = 0)
rowMads(x,method = "median",na.rm=FALSE,parallel = FALSE, cores = 0)
Mad(x,method = "median",na.rm=FALSE)

Arguments

x

A vector, matrix or data.frame with the data.

method

A character vector with values "median", for median absolute deviation or "mean", for mean absolute deviation.

na.rm

A logical value TRUE/FALSE to remove NAs.

parallel

A boolean value for parallel version.

cores

Number of cores to use for parallelism. Valid only when argument parallel is set to TRUE. Default value is 0 and it means the maximum supported cores.

Details

The functions is written in C++ in order to be as fast as possible.

Value

A vector with the column-wise mean absolute deviations.

Author(s)

Manos Papadakis

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

See Also

colMedians, rowMedians, colVars, colmeans, colMeans (buit-in R function)

Examples

x <- matrix( rnorm(100 * 100), ncol = 100 )
a <- colMads(x)

x<-NULL

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.