alleles2genotypes: Convert Alleles to Genotypes (hierfstat format)

Description Usage Arguments Value Author(s) Examples

View source: R/alleles2genotypes.R

Description

A function that will return a data frame in genotype per column format from a data frame in allele per column format.

Usage

1
alleles2genotypes(df, allele_cols, allelesAsIntegers = TRUE)

Arguments

df

Data frame that contains genotypic data and metadata

allele_cols

Numeric column identifiers of loci

allelesAsIntegers

For alleles with zeros use FALSE. If FALSE this will eliminate the loss of leading zeros, but will not be usable in 'hierfstat'. When TRUE the genotypes are converted to integers for 'hierfstat' package.

Value

Data frame in genotype per column format

Author(s)

Zak Robinson, Contact: zachary.robinson(at)umontana.com

Examples

1
2
3
data("wgp_example_2col")
genotypes<-alleles2genotypes(df=wgp_example_2col,allele_cols = 3:ncol(wgp_example_2col),
allelesAsIntegers=TRUE)

zakrobinson/RLDNe documentation built on April 12, 2021, 1:50 p.m.