hypervolume_distance {hypervolume} | R Documentation |
Distance between two hypervolumes
Description
Calculates the distance between two hypervolumes either defined as the Euclidean distance between centroids or as the minimum Euclidean distance between the random points comprising either hypervolume.
Usage
hypervolume_distance(hv1, hv2, type = "centroid",
num.points.max = 1000, check.memory = TRUE)
Arguments
hv1 |
A |
hv2 |
A |
type |
If 'centroid', the centroid distance; if 'minimum', the minimum distance. |
num.points.max |
The number of random points to subsample from each input hypervolume. Ignored if |
check.memory |
If |
Details
Minimum distance calculations scale quadratically with npmax
and may be computationally costly.
Value
The distance between the two hypervolumes.
Examples
## Not run:
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
penguins_chinstrap = penguins_no_na[penguins_no_na$species=="Chinstrap",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
hv1 = hypervolume_gaussian(penguins_adelie)
hv2 = hypervolume_gaussian(penguins_chinstrap)
# note that minimum distance is smaller than centroid distance as expected
hypervolume_distance(hv1, hv2, type='centroid')
hypervolume_distance(hv1, hv2, type='minimum', num.points.max=500, check.memory=FALSE)
## End(Not run)
[Package hypervolume version 3.1.4 Index]