UniqueGenotypeCounts: Extract unique genotypic compositions from a matrix

View source: R/UniqueGenotypeCounts.R

UniqueGenotypeCountsR Documentation

Extract unique genotypic compositions from a matrix

Description

Function UniqueGenotypeCounts creates a matrix containing only the unique rows in the given matrix, together with their frequency of occurrence

Usage

UniqueGenotypeCounts(X, verbose = TRUE)

Arguments

X

A n by 3 matrix with genotypic counts (AA,AB,BB)

verbose

If TRUE then print some statistics

Value

A matrix with 4 columns, AA, AB, BB, and frequency of occurrence

Author(s)

Jan Graffelman jan.graffelman@upc.edu

See Also

GenerateSamples

Examples

set.seed(123)
X <- HWData(n=100,nm=100)
print(nrow(X))
Y <- UniqueGenotypeCounts(X)
print(nrow(Y))
print(sum(Y$w))

HardyWeinberg documentation built on May 7, 2022, 5:05 p.m.