R/prodepth.R

prodepth <-
function(x,pts=x,ndir=1000,SEED=FALSE){
#
#  Determine an approximation of the projection depth of
#  pts in
#  x 
#  using the R package library(DepthProc)
#
#  ndir indicates how many randomly chosen projections will be used
#
#  Advantage over zoudepth, much faster execution time.
#  Should be noted, however, that using the function twice on the same
#  data generally results in different values for the depths.
#  Setting 
#  SEED=TRUE
#  avoids this.
#  
#
if(SEED){
oldSeed <- .Random.seed
set.seed(45)
}
library(DepthProc)
res=as.vector(depthProjection(pts,x,ndir=ndir))
if(SEED) {
    assign(x='.Random.seed', value=oldSeed, envir=.GlobalEnv)
}
res
}
musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.