get_rao_index: Rao's index of a numeric vector

Description Usage Arguments Details Value References Examples

Description

Calculates Rao's index.

Usage

1
get_rao_index(numeric_v, is_rao = TRUE)

Arguments

numeric_v

numeric vector of 3 values at the very least

is_rao

boolean to get Rao's index back (default) or Shannon's index

Details

Rao's quadratic entropy is a measure of diversity of ecological communities defined by Rao (1982) and is based on the proportion of the abundance of species present in a community and some measure of distance (dissimilarity) among them. Dissimilarity is defined as the euclidean distance.

ρ = \deqn{∑_{ij}d_{ij} p_i p_j }

The function accepts a numeric value vector (or matrix of numeric values) and returns Rao's index. It is particularly useful in remote sensing applications as it can be used to calculate a temporal diversity index between layers of raster stacks.

Currently only euclidean distance is supported to compute pairwise distance.

Value

a scalar value (the rao's index)

References

Rao, C. R. (1982). Diversity and dissimilarity coefficients: a unified approach. Theoretical Population Biology, 21(1), 24–43 https://doi.org/10.1016/0040-5809(82)90004-1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
i <- 1; j <- 200
m <- c(i, i, j, i, j, j, j, j, j)
get_rao_index(m)

i <- 201; j <- 200
m <- c(i, i, j, i, j, j, j, j, j)
get_rao_index(m)

# pass a matrix to get_rao_index, as a matrix is just a vector with an x and y dimensions
M <- matrix(m, byrow = TRUE, nrow = 3)
identical(get_rao_index(M), get_rao_index(m))
# [1] TRUE

mbask/spacetimerao documentation built on May 17, 2019, 11:08 a.m.