View source: R/func__geoTempAnalyser__calcAllelicDiversityPerCountry.R
calcAllelicDiveristyPerCountry | R Documentation |
Calculate Simpson's or Shannon's diversity index for alleles per country or any other kind of geographic regions. Each strain must belong to only a single country.
calcAllelicDiveristyPerCountry( sam, pam, alleles = NULL, countries = NULL, method = "simpson", shannon_base = exp(1) )
sam |
A data frame whose first and second columns are strain and country names, respectively. |
pam |
A binary allelic presence-absence matrix, where row names are strain names and column names are allele names. |
alleles |
A character vector specifying alleles to be analysed. Keep NULL to include all alleles in pam. |
countries |
A character vector specifying countries to be considered. Keep NULL to include all countries in pam. |
method |
A character argument of either "simpson" or "shannon". |
shannon_base |
The base for Shannon's diversity index. It is not used for Simpson's diveristy index. Default: exp(1). |
A list of four elements: c: a matrix of n(countries) by n(alleles) for allele counts per country; d: a named numeric vector of diversity indices. p: the final allelic presence-absence matrix on which the diversity indices are computed. s: isolation information of the final set of strains.
Yu Wan (wanyuac@126.com)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.