genind2genpop {adegenet}R Documentation

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).

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.

Value

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

Author(s)

Thibaut Jombart jombart@biomserv.univ-lyon1.fr

See Also

genind, genpop, na.replace

Examples

  data(nancycats)
  nancycats
  catpop <- genind2genpop(nancycats)
  catpop
  summary(catpop)

[Package adegenet version 1.2-2 Index]