toTriangular: Convert a vector of genotype counts to triangular format

View source: R/toTriangular.R

toTriangularR Documentation

Convert a vector of genotype counts to triangular format

Description

Function toTriangular converts a named vector of genotype counts into a triangular matrix format, with homozygotes on the diagonal and heterozygotes below the diagonal.

Usage

toTriangular(x)

Arguments

x

A vector of genotype counts

Value

a matrix

Author(s)

Jan Graffelman jan.graffelman@upc.edu

Examples

x <- c(AA=20,AB=52,AC=34,BB=17,BC=51,CC=26)
print(x)
X <- toTriangular(x)
print(X)

HardyWeinberg documentation built on May 29, 2024, 6:17 a.m.