library(plotly)
mdepth <- function(pts, x){
mahalanobis(pts, center = rep(0, 3),
cov = diag(1, 3))
}
set.seed(100)
x <- cbind(X1=rnorm(300), X2=rnorm(300), X3=rnorm(300))
out <-npmvtol.region(x = x, alpha = 0.10, P = 0.90, depth.fn = mdepth,
type = "semispace", semi.order = list(lower = 2,
center = 3, upper = 1))
gg.out <- plotly_npmvtol(tol.out = out , x = x)
Run the code above in your browser using DataLab