data(cork)
set.seed(1234)
n <- nrow(cork)
err1 <- rnorm(n,0,sd(cork[,1])/100)
err2 <- rnorm(n,0,sd(cork[,2])/100)
err3 <- rnorm(n,0,sd(cork[,3])/100)
err4 <- rnorm(n,0,sd(cork[,4])/100)
cork <- cork + data.frame(err1,err2,err3,err4)
tau <- quantile.localdepth(cork, probs=0.1, size=TRUE, use='volume')
boxplot(tau$stats)
depth <- localdepth(x=cork, tau=tau$quantile, tol=0, method='simplicial', use='volume')
plot(depth)
abline(0, 1, lty=2)
Run the code above in your browser using DataLab