colMads: Column and row-wise mean absolute deviations

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/mad2.R

Description

Column and row-wise mean absolute deviations.

Usage

1
2
colMads(x,method = "median",na.rm=FALSE,parallel = FALSE)
rowMads(x,method = "median",na.rm=FALSE,parallel = FALSE)

Arguments

x

A matrix 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.

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)

Michail Tsagris

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

1
2
3
4
x <- matrix( rnorm(100 * 100), ncol = 100 )
system.time( a <- colMads(x) )

x<-NULL

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat
   user  system elapsed 
  0.001   0.000   0.004 

Rfast documentation built on May 18, 2021, 1:07 a.m.