Skip to contents

Shannon-Wiener diversity \(H = -\sum_k p_k \ln p_k\) per grid cell and overall (natural-log convention, nats), with richness S (count of distinct taxa) and Pielou evenness \(J = H/\ln S\) (NaN when S = 1). Points are assigned to a grid by grid lattice of cells over the bounding box.

Usage

Frtaxd(coords, species, grid = 4L)

forest_taxon_diversity(coords, species, grid = 4L)

Arguments

coords

Point locations, n by 2.

species

Taxon labels, length n.

grid

Number of grid cells per axis.

Value

List with H (grid by grid, NaN where empty), richness, counts, H_overall, S_overall, J_overall, grid, n.

References

Shannon, C. E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27, 379-423, Sec. 6 (entropy H).

Pielou, E. C. (1966). The measurement of diversity in different types of biological collections. Journal of Theoretical Biology, 13, 131-144.

Magurran, A. E. (2004). Measuring Biological Diversity. Blackwell.

Examples

set.seed(1)
Frtaxd(cbind(runif(20), runif(20)), sample(letters[1:3], 20, TRUE), grid = 2)
#> $H
#>           [,1]      [,2]
#> [1,] 1.0397208 0.5004024
#> [2,] 0.8675632 1.0549202
#> 
#> $richness
#>      [,1] [,2]
#> [1,]    3    2
#> [2,]    3    3
#> 
#> $counts
#>      [,1] [,2]
#> [1,]    4    5
#> [2,]    6    5
#> 
#> $H_overall
#> [1] 0.9972715
#> 
#> $S_overall
#> [1] 3
#> 
#> $J_overall
#> [1] 0.9077557
#> 
#> $grid
#> [1] 2
#> 
#> $n
#> [1] 20
#> 
#> $method
#> [1] "Shannon-Wiener diversity per grid cell (nats)"
#>