Skip to contents

Similarity

Usage

similarity(object, ...)

# S4 method for class 'matrix'
similarity(
  object,
  method = c("brainerd", "bray", "jaccard", "morisita", "sorenson", "binomial")
)

# S4 method for class 'data.frame'
similarity(
  object,
  method = c("brainerd", "bray", "jaccard", "morisita", "sorenson", "binomial")
)

Arguments

object

A \(m \times p\) numeric matrix or data.frame of count data (absolute frequencies giving the number of individuals for each category, i.e. a contingency table). A data.frame will be coerced to a numeric matrix via data.matrix().

...

Currently not used.

method

A character string specifying the method to be used (see details). Any unambiguous substring can be given.

Value

A stats::dist object.

Details

\(\beta\)-diversity can be measured by addressing similarity between pairs of samples/cases (Brainerd-Robinson, Jaccard, Morisita-Horn and Sorenson indices). Similarity between pairs of taxa/types can be measured by assessing the degree of co-occurrence (binomial co-occurrence).

Jaccard, Morisita-Horn and Sorenson indices provide a scale of similarity from \(0\)-\(1\) where \(1\) is perfect similarity and \(0\) is no similarity. The Brainerd-Robinson index is scaled between \(0\) and \(200\). The Binomial co-occurrence assessment approximates a Z-score.

binomial

Binomial co-occurrence assessment.

brainerd

Brainerd-Robinson quantitative index.

bray

Sorenson quantitative index.

jaccard

Jaccard qualitative index.

morisita

Morisita-Horn quantitative index.

sorenson

Sorenson qualitative index.

References

Magurran, A. E. (1988). Ecological Diversity and its Measurement. Princeton, NJ: Princeton University Press. doi:10.1007/978-94-015-7358-0 .

Author

N. Frerebeau

Examples

## Data from Huntley 2004, 2008
data("pueblo")

## Brainerd-Robinson measure
(C <- similarity(pueblo, "brainerd"))
#>             Atsinna   Cienega   Mirabal PdMuertos      Hesh   LowPesc      BoxS
#> Cienega   164.36782                                                            
#> Mirabal   152.38095 138.09524                                                  
#> PdMuertos 179.31034 150.57471 152.38095                                        
#> Hesh       82.75862  55.55556  66.66667 103.44828                              
#> LowPesc    89.21023  62.00717  73.11828 109.89989 193.54839                    
#> BoxS       82.75862  55.55556 114.28571 102.17114 103.70370 103.70370          
#> Ojo Bon    27.58621  22.22222  19.04762  20.68966  26.66667  25.80645  22.22222
#> S170       27.58621  22.22222  19.04762  20.68966  26.66667  25.80645  22.22222
#>             Ojo Bon
#> Cienega            
#> Mirabal            
#> PdMuertos          
#> Hesh               
#> LowPesc            
#> BoxS               
#> Ojo Bon            
#> S170      190.53030
plot_spot(C)


## Data from Magurran 1988, p. 166
data("aves")

## Jaccard measure (presence/absence data)
similarity(aves, "jaccard") # 0.46
#>         unmanaged
#> managed 0.4615385

## Sorenson measure (presence/absence data)
similarity(aves, "sorenson") # 0.63
#>         unmanaged
#> managed 0.6315789

# Jaccard measure (Bray's formula ; count data)
similarity(aves, "bray") # 0.44
#>         unmanaged
#> managed 0.4442754

# Morisita-Horn measure (count data)
similarity(aves, "morisita") # 0.81
#>         unmanaged
#> managed 0.8134497