addLocus: Add genotype data to an object of class genalex

Description Usage Arguments Value Author(s) Examples

Description

Add genotype genotype data for new loci to an object of class genalex. newdata is coerced to a data frame if it is not already and then added as columns on the right. The new genotype data must have the same ploidy and the same number of samples as that in x. It is an error to duplicate locus names in x. If you want safe merging of data sets with potential overlap in genotypes, use cbind.genalex.

Usage

1
2
## S3 method for class 'genalex'
addLocus(x, newdata, ...)

Arguments

x

An annotated data frame of class genalex

newdata

The names of one or more loci found in x, it is coerced to a data frame if it is not one

...

Additional arguments, currently ignored

Value

The object of class genalex in x with genotype data from newdata as columns added on the right

Author(s)

Douglas G. Scofield

Examples

1
2
3
4
5
6
data(Qagr_pericarp_genotypes)
dat <- head(Qagr_pericarp_genotypes, 6)
## Dummy up a new locus
newdat <- data.frame(xx = sample(30, 6, TRUE), xx.2 = sample(30, 6, TRUE))
dat <- addLocus(dat, newdat)
dat

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