Learn R Programming

adegenet (version 1.4-2)

genpop constructor: genpop constructor

Description

Constructor for genpop objects. The function genpop creates a genpop object from a matrix of alleles counts where genotypes are in rows and alleles in columns. This table must have correct names for rows and columns. The function as.genpop is an alias for genpop function. is.genpop tests if an object is a valid genpop object. Note: to get the manpage about genpop, please type 'class ? genpop'.

Usage

genpop(tab,prevcall=NULL, ploidy=as.integer(2), type=c("codom","PA"))
as.genpop(tab, prevcall=NULL, ploidy=as.integer(2), type=c("codom","PA"))
is.genpop(x)

Arguments

tab
a pop x alleles matrix which terms are numbers of alleles, i.e. like in a genpop object
prevcall
call of an object
ploidy
an integer indicating the degree of ploidy of the genotypes. Beware: 2 is not an integer, but as.integer(2) is.
type
a character string indicating the type of marker: 'codom' stands for 'codominant' (e.g. microstallites, allozymes); 'PA' stands for 'presence/absence' (e.g. AFLP, RAPD).
x
an object

Value

  • For genpop and as.genpop, a genpop object. For is.genpop, a logical.

encoding

UTF-8

See Also

genpop class, and genind2genpop for conversion from a genind to a genpop object.

Examples

Run this code
data(nancycats)
obj <- genind2genpop(nancycats)

# isolate one locus, fca77
obj <- seploc(obj)$"fca77"
obj

Run the code above in your browser using DataLab