Calculates depth functions.

fncDepth(u, X = NULL, method = "MBD", byrow = NULL, ...)

# S3 method for matrix
fncDepth(u, X = NULL, method = "MBD", byrow = NULL,
  ...)

# S3 method for zoo
fncDepth(u, X = NULL, method = "MBD", byrow = NULL,
  ...)

Arguments

u

data

X

reference set. If null u will be used as reference.

method

depth method - "MBD" (default), or "FM" (Frainman-Muniz depth)

byrow

logical or character.

additional arguments passed to fncDepthFM.

Examples

x <- matrix(rnorm(60), ncol = 20) fncDepth(x, method = "FM", dep1d = "Mahalanobis")
#> Warning: Coercing LHS to a list
#> Depth method: FM #> [1] 0.7085207 0.6001410 0.6556253
fncDepth(x, byrow = FALSE)
#> Depth method: MBD #> [1] 0.4964912 0.4438596 0.2894737 0.4263158 0.2754386 0.2894737 0.5350877 #> [8] 0.4017544 0.3771930 0.2578947 0.2859649 0.3842105 0.3666667 0.4614035 #> [15] 0.5421053 0.4052632 0.4122807 0.4859649 0.4403509 0.4228070
# zoo and xts library(xts) data(sample_matrix) sample.xts <- as.xts(sample_matrix, descr = "my new xts object") fncDepth(sample.xts)
#> Depth method: MBD #> [1] 0.7847222 0.5763889 0.5844907 0.7854167