pop_gen_index {graph4lg} | R Documentation |
Compute population-level genetic indices
Description
The function computes population-level genetic indices from an
object of class genind
.
Usage
pop_gen_index(x, pop_names = NULL, indices = c("Nb_ind", "A", "He", "Ho"))
Arguments
x |
An object of class |
pop_names |
(optional) A character vector indicating population names. It is of the same length as the number of populations. Without this argument, populations are given the names they have initially in the 'genind' object (which is sometimes only a number). The order of the population names must match with their order in the 'genind' object. The function does not reorder them. Users must be careful. |
indices |
(optional) A character vector indicating the population-level indices to compute. These indices can be:
By default, |
Value
An object of class data.frame
whose rows
correspond to populations and columns to population attributes
(ID, size, genetic indices). By default, the first column corresponds to
the population names (ID). The order of the columns depends on the
vector 'indices'.
Author(s)
P. Savary
Examples
data(data_ex_genind)
x <- data_ex_genind
pop_names <- levels(x@pop)
df_pop_indices <- pop_gen_index(x = x,
pop_names = pop_names,
indices = c("Nb_ind", "A"))