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
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.