genalex: Create new object of class genalex from constituent data

Description Usage Arguments Value Author(s) See Also Examples

Description

Create a new object of class genalex given sample and population names and genotype data. Titles for the dataset, sample and population columns, and loci may be provided via the names argument.

Usage

1
2
genalex(samples, pops, genotypes, names = NULL, ploidy = 2,
  extra.columns = NULL)

Arguments

samples

Sample names, must be unique and length must match the number of rows in genotypes

pops

Population names. If pops is shorter than the number of samples, it will be expanded following the rules described in data.frame.

genotypes

Genotype values, must be numeric

names

List of names: title for data set title, sample for sample column header, pop for population column header, and loci for names of loci. If loci is missing, the corresponding genotype column names are used. If loci is present but not the same length as the number of loci, an error is produced

ploidy

Ploidy of genotypes

extra.columns

Extra data columns, see readGenalex

Value

Annotated data frame of class genalex. If names or any of its fields are not provided, default names are used. The data.file.name attribute is a character representation of the call to genalex.

Author(s)

Douglas G. Scofield

See Also

readGenalex, data.frame

Examples

1
2
3
4
5
gt <- data.frame(a = 11:13, a.2 = 14:16, b = 101:103, b.2 = 104:106)
nms <- list(title = "Example")
x <- genalex(1:3, "snurf", gt, nms)
x
attributes(x)

douglasgscofield/readGenalex documentation built on May 15, 2019, 10:43 a.m.