I am trying to compute the data depth of two variables with the following function:
library(depth) x <- data.frame(data$`math score`, data$`reading score`) depth(1000, x, method = "Tukey", approx = FALSE, eps = 1e-8, ndir = 1000)
the first variable after depth is u which stands for Numerical vector whose depth is to be calculated. Dimension has to be the same as that of the observations. I have 1000 observations however I get the following error message:
Error in depth(1000, x, method = "Tukey", approx = FALSE, eps = 1e-08, : Dimension mismatch between the data and the point u.
Does someone know how to solve this issue? Thank you in advance!