Learn R Programming

poolHelper (version 1.1.0)

hap2geno: Convert haplotypes to genotypes

Description

This function converts haplotypes simulated with scrm::scrm() into genotypes by adding the entries on one row with the entries of the subsequent row.

Usage

hap2geno(haplo)

Value

a matrix of genotypes with half the rows of the haplo matrix. Each column of this matrix is a different site and each row is a different genotype.

Arguments

haplo

a matrix of haplotypes obtained from the simulations done with scrm::scrm(). Each column of the matrix is a different site and each row is a different haplotype.