mmedian: Median of multidimensional data

Description Usage Arguments Details Value

View source: R/mmedian.R


Median of multidimensional data


mmedian(x, metric = "euclidean", q = 3, simple1d = TRUE, ...)



a matrix, data frame or vector of data points (a vector will be understood as 1D data, equivalent to a 1-column matrix). Rows with NA values will be dropped.


a choice of 'euclidean','maximum','manhattan','canberra','minkowski', or 'binary'. Any unambiguous substring can be given, case insensitive.


the power in the minkowski metric. If q=2, equivalent to 'euclidean'.


boolean, if TRUE, will resort to the standard median function in case the data is 1D. This means that only euclidean metric will be used. However, most metrics are identical to euclidean in 1D anyway, so it is usually no big loss.


other arguments passed to Rcgmin::Rcgmin.


The median is calculated as the minimizer m of the sum of distances ||x_i-m||, where x_i are the data points. In an N-dimensional space, each x_i is an N-dimensional vector, and so is m. The distances are calculated according to the metric chosen (Euclidean by default). Minimization is done with Rcgmin (note that exotic metrics you might cause convergence issues). In 1D case, unless simple1d is FALSE, the standard median function is used instead of this method.


a vector of median components.

rushkin/outlier documentation built on Oct. 13, 2018, 10:48 a.m.