polyRAD (version 1.0)

OneAllelePerMarker: Return the Index of One Allele for Each Locus

Description

This function exists primarily to be called by functions such as AddPCA and GetWeightedMeanGenotypes that may need to exclude one allele per locus to avoid mathematical singularities. For a "RADdata" object, it returns the indices of one allele per locus.

Usage

OneAllelePerMarker(object, ...)
# S3 method for RADdata
OneAllelePerMarker(object, commonAllele = FALSE, …)

Arguments

object

A "RADdata" object.

commonAllele

If TRUE, the index of the most common allele for each locus is returned, according to object$alleleFreq. If FALSE, the index of the first allele for each locus is returned.

Additional arguments (none implemented).

Value

An integer vector indicating the index of one allele for each locus in object.

See Also

GetTaxa for a list of accessors.

Examples

Run this code
# NOT RUN {
data(exampleRAD)

OneAllelePerMarker(exampleRAD)

OneAllelePerMarker(exampleRAD, commonAllele = TRUE)
# }

Run the code above in your browser using DataLab