View source: R/allele_counts_to_freqs.R
allele_counts_to_freqs | R Documentation |
Convert allele counts data frame to list of frequencies by locus
allele_counts_to_freqs(x, remove_zeroes = TRUE)
x |
A data fram with columns: |
remove_zeroes |
Logical. Should zero-count alleles be removed? Default
is |
Named list with frequencies per locus. Each element is a named
numeric vector of allele frequencies.
An attribute N
gives the number of allele observations per
locus.
x <- data.frame(
locus = "D3S1358",
allele = c("12", "13", "14", "15", "15.2", "16", "17", "18", "19"),
count = c(3, 2, 62, 211, 1, 218, 145, 39, 3)
)
freqs <- allele_counts_to_freqs(x)
freqs
attr(freqs, "N")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.