matchAfreq | R Documentation |
Checks if the list containing sample data is conformable to provided population allele frequencies and reformats it if needed.
matchAfreq(dsmp, afreq)
dsmp |
a list with each element corresponding to one sample. |
afreq |
a list of allele frequencies. Each element of the list corresponds to a locus. |
The function reorders loci and alleles in dsmp
to match those
in afreq
and inserts alleles into dsmp
if they are present in
afreq
and not in dsmp
; doesn't handle cases when alleles are
present in dsmp
but not in afreq
. Allele names are required
for this procedure.
A list of the same length as dsmp
, with each element matching
the lengths and the names of afreq
and its elements.
readDat
and readAfreq
for reading in and
reformating data.
afile <- system.file("extdata", "MozAfreq.csv", package = "dcifer")
afreq2 <- readAfreq(afile, lvar = "locus", avar = "allele", fvar = "freq")
dsmp2 <- matchAfreq(dsmp, afreq2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.