Learn R Programming

hypervolume (version 1.2.2)

hypervolume_sorensen_overlap: Sorensen similarity index for hypervolume set operations

Description

Calculates the Sorensen index, i.e. for hypervolumes A and B, 2*|A int B| / (|A| + |B|). Note that this definition has been changed since version 1.2 of the package.

Usage

hypervolume_sorensen_overlap(hvlist)

Arguments

hvlist
A HypervolumeList object corresponding to the output of a hypervolume_set command.

Value

  • A number between 0 and 1 indicating how similar two input hypervolumes are.

Examples

Run this code
data(iris)
hv2 = hypervolume(subset(iris, Species=="virginica")[,1:4],reps=1000,bandwidth=0.2,warn=FALSE)
hv3 = hypervolume(subset(iris, Species=="versicolor")[,1:4],reps=1000,bandwidth=0.2,warn=FALSE)

hv_set23 = hypervolume_set(hv2, hv3, check_memory=FALSE)

# no overlap found between setosa and virginica
hypervolume_sorensen_overlap(hv_set23)

Run the code above in your browser using DataLab