R/dmedian.R

dmedian <-
function(x,depfun=pdepth,...){
#
# Compute the median based on the deepest point for the multivariate 
# data in x
#
#  For continuous variables, this function returns a unique median
#
#  Projection distances are used by default.
# Another option is depfun=zdepth
#
if(is.null(dim(x)) || dim(x)==1)stop('x should be a matrix with two or more columns')
val=depfun(x,...)
id=which(val==max(val))
list(center=x[id,])
}
musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.