Description Usage Arguments Details Value References Examples
Calculates Rao's index.
1 | get_rao_index(numeric_v, is_rao = TRUE)
|
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 |
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.
a scalar value (the rao's index)
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
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.