as.loci {pegas}R Documentation

Conversion Among Allelic Data Classes

Description

These functions do conversion among different allelic data classes.

Usage

as.loci(x, ...)
## S3 method for class 'genind':
as.loci(x, ...)
genind2loci(x)
## S3 method for class 'data.frame':
as.loci(x, allele.sep = "/", col.pop = "none", col.loci = NULL, ...)
loci2genind(x)
## S3 method for class 'factor':
as.loci(x, allele.sep = "/", ...)
## S3 method for class 'vector':
as.loci(x, allele.sep = "/", ...)

Arguments

x an object of class "loci" or "genind", a data frame, a factor, or a vector.
allele.sep the character(s) separating the alleles for each locus in the data file (a slash by default).
col.pop specifies whether one of the column of the data file identifies the population; default "none", otherwise an integer giving the number of the column.
col.loci a vector of integers specifying the indices of the columns that are loci. By default, all columns are taken as loci except one labelled "population", if present.
... further arguments to be passed to or from other methods.

Details

genind2loci(x) and as.loci(x) are the same if x is of class "genind".

Value

a data frame with class c("loci", "data.frame") for as.loci and genind2loci; an object of class "genind" for loci2genind.

Author(s)

Emmanuel Paradis

See Also

read.loci


[Package pegas version 0.1 Index]