Learn R Programming

adegenet (version 1.2-1)

genind2genpop: Conversion from a genind to a genpop object

Description

The function genind2genpop converts genotypes data (genind) into alleles counts per population (genpop).

Usage

genind2genpop(x,pop=NULL,missing=c("NA","0","chi2"),quiet=FALSE)

Arguments

x
an object of class genind.
pop
a factor giving the population of each genotype in 'x'. If note provided, seeked in x@pop, but if given, the argument prevails on x@pop.
missing
can be "NA", "0", or "chi2". See details for more information.
quiet
logical stating whether a conversion message must be printed (TRUE,default) or not (FALSE).

Value

  • A genpop object. The component @other in 'x' is passed to the created genpop object.

encoding

UTF-8

Details

The values of the 'missing' argument in genind2genpop have the following effects: - "NA": if all genotypes of a population for a given allele are missing, count value will be NA - "0": if all genotypes of a population for a given allele are missing, count value will be 0 - "chi2": if all genotypes of a population for a given allele are missing, count value will be that of a theoretical count in of a Chi-squared test. This is obtained by the product of the margins sums divided by the total number of alleles.

See Also

genind, genpop, na.replace

Examples

Run this code
data(nancycats)
  nancycats
  catpop <- genind2genpop(nancycats)
  catpop
  summary(catpop)

Run the code above in your browser using DataLab