getLocus: Return genotype data for specified loci

Description Usage Arguments Value Author(s) Examples

Description

Return genotype data for specified loci in an object of class 'data.frame', optionally restricted to samples from specific populations.

Usage

1
2
## S3 method for class 'genalex'
getLocus(x, locus, pop = NULL, ...)

Arguments

x

An annotated data frame of class genalex

locus

The names of one or more loci found in x

pop

If supplied, return only data for samples from the specified populations

...

Additional arguments, currently ignored

Value

An object of class 'data.frame' containing genotype data from x for loci specified in code, optionally restricted to samples from populations specified in pop.

Author(s)

Douglas G. Scofield

Examples

1
2
3
4
5
6
7
data(Qagr_pericarp_genotypes)
nm <- attr(Qagr_pericarp_genotypes, "locus.names")
# get the first locus
loc1 <- getLocus(Qagr_pericarp_genotypes, nm[1])
# get the second locus of the second population
po <- attr(Qagr_pericarp_genotypes, "pop.labels")
loc2.pop2 <- getLocus(Qagr_pericarp_genotypes, nm[2], po[2])

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