Description Usage Arguments Value Note Examples
View source: R/04_comparison_metrics.R
Distance metric with optional user input for specifying how much the bin size similarity and color similarity should be weighted when pairing clusters from different color cluster sets.
1 2 3 4 5 6 7 | weightedPairsDistance(
T1,
T2,
ordering = FALSE,
size.weight = 0.5,
color.weight = 0.5
)
|
T1 |
Dataframe (especially a dataframe as returned by
|
T2 |
Another dataframe like T1. |
ordering |
Logical. Should clusters by paired in order to minimize overall distance scores or evaluated in the order given? |
size.weight |
Weight of size similarity in determining overall score and ordering (if ordering=T). |
color.weight |
Weight of color similarity in determining overall score and ordering (if ordering=T). Color and size weights do not necessarily have to sum to 1. |
Similarity score based on size and color similarity of each pair of points in provided dataframes.
Use with caution, since weights can easily swing distance scores more
dramatically than might be expected. For example, if size.weight
= 1
and color.weight
= 0, two clusters of identical color but different
sizes would not be compared.
1 2 3 4 5 6 | cluster.list <- colordistance::getKMeansList(system.file("extdata",
"Heliconius/Heliconius_B", package="colordistance"), lower=rep(0.8, 3),
upper=rep(1, 3))
cluster.list <- colordistance::extractClusters(cluster.list, ordering=TRUE)
colordistance:::weightedPairsDistance(cluster.list[[1]], cluster.list[[2]],
size.weight=0.8, color.weight=0.2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.