depth_median {gggda} | R Documentation |
Depth median
Description
Compute the depth median of a data set.
Usage
depth_median(x, notion = "zonoid", ...)
Arguments
x |
Matrix of data whose depth median is to be calculated; see
|
notion |
The name of the depth notion (shall also work with a user-defined depth function named |
... |
Additional parameters passed to the depth functions. |
Details
This function is called internally by stat_bagplot()
and can be
passed to stat_center()
but is also exported directly for data analysis.
Value
A one-row matrix of depth median coordinates.
Examples
# sample median
iris %>%
subset(select = -Species) %>%
depth_median()
# groupwise medians
iris %>%
split(~ Species) %>%
lapply(subset, select = -Species) %>%
lapply(depth_median) %>%
simplify2array() %>% t() %>% as.data.frame()
[Package gggda version 0.1.1 Index]