alleleFreq: Calculates the count of each allele in the provided vector.

View source: R/alleleFreq.R

alleleFreqR Documentation

Calculates the count of each allele in the provided vector.

Description

Part of Genetic Value Analysis

Usage

alleleFreq(alleles, ids = NULL)

Arguments

alleles

an integer vector of alleles in the population

ids

character vector of IDs indicating to which animal each allele in alleles belongs.

Details

If ids are provided, the function will only count the unique alleles for an individual (homozygous alleles will be counted as 1).

Value

A data.frame with columns allele and freq. This is a table of allele counts within the population.

Examples

library(nprcgenekeepr)
data("ped1Alleles")
ids <- ped1Alleles$id
alleles <- ped1Alleles[, !(names(ped1Alleles) %in% c("id", "parent"))]
aF <- alleleFreq(alleles[[1]], ids = NULL)
aF[aF$freq >= 10, ]

rmsharp/nprcmanager documentation built on Feb. 2, 2025, 12:45 a.m.