View source: R/04_comparison_metrics.R
EMDistance | R Documentation |
Calculates the
Earth
mover's distance (briefly, the amount of work required to move the data from
one distribution to resemble the other distribution, or the amount of "dirt"
you have to shovel weighted by how far you have to shovel it). Accounts for
both color disparity and size disparity. Recommended unless binAvg
is
off for histogram generation. Note: this function is not exported by the package,
since it is fairly specific to the colordistance framework. For a more generic
implementation of EMD, see the [emdist::emd] function in the emdist package.
EMDistance(T1, T2)
T1 |
Dataframe (especially a dataframe as returned by
|
T2 |
Another dataframe like T1. |
Earth mover's distance between the two dataframes (metric of overall bin similarity for a pair of 3-dimensional histograms).
## Not run:
cluster.list <- colordistance::getHistList(system.file("extdata",
"Heliconius/Heliconius_B", package="colordistance"), lower=rep(0.8, 3),
upper=rep(1, 3))
colordistance:::EMDistance(cluster.list[[1]], cluster.list[[2]])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.