View source: R/dispRity.fast.R
dispRity.fast | R Documentation |
Fast disparity calculations. THIS FUNCTION IS LESS SAFE TO USE THAN dispRity
(see details).
dispRity.fast(group, space, metric, ...)
group |
a logical vector for grouping |
space |
a matrix |
metric |
a metric dispRity style (up to two levels) |
... |
any additional arguments to be passed to |
IN DOUBT, USE dispRity
INSTEAD OF THIS FUNCTION.
This function should only be used in very specific cases requiring advanced optimisation or embedded customised functions.
This function is simply applying metric(space[group,])
for each group and returns a list of results.
It does not check the validity of the data, metric and groups.
It does not handle specific data (e.g. multiple matrices), specific metrics (e.g. no optional arguments), does not produce meaningful error messages and does not intake nor returns a dispRity object.
Thomas Guillerme
## A random space
space <- matrix(rnorm(25), 5, 5)
## A metric
metric <- c(sum, variances)
## A group of four observations
group <- c(TRUE, TRUE, TRUE, TRUE, FALSE)
## The disparity
dispRity.fast(group, space, metric)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.