| distanceToCenter | R Documentation |
Computes the distance of a datapoint to the center of a dataset, for the definition of central regions.
distanceToCenter(x, na.rm = TRUE, ...)
## Default S3 method:
distanceToCenter(
x,
na.rm = TRUE,
...,
distType = c("meandistance", "median", "spatialdepth")
)
x |
the dataset |
na.rm |
boolean whether to remove na values in dist |
... |
further parameters to dist |
distType |
"meandistance" for mean distance to datapoints, "median" for distance to median, "spatialdepth" for one minus spatial depth. |
A numeric vector of distances of each observation to the centre of the dataset.
distanceToCenter(default): default method
Other caseStatistics:
caseE(),
caseLogRatios(),
caseMeans(),
caseQuantiles(),
caseSds(),
caseVars(),
centralityQuantile(),
median.BData(),
spatialDepth()
x = rnorm(100)
plot(x,distanceToCenter(x,distType="median"),col="green")
points(x,distanceToCenter(x,distType="meandist"))
points(x,distanceToCenter(x,distType="spatialdepth"),col="red")
data(DTD)
Xpdf = BDataPDFs(DTD$shapePDF,basis=B2Unif01Basis5)
distanceToCenter(Xpdf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.