Normalize a list of frequencies at a series of genetic loci both sum to one. Not that this does not deal with the problem of values larger than one or smaller than zero.
normalizeFreqs(Freqs)
A list containg elements loci
and freqs
. freqs
is a list of vectors containing the frequencies at the given loci.
A list containg elements loci
and freqs
.
freqs
is a list of vectors containing the frequencies at the given
loci.
James M. Curran
Divides vector in Freqs$freqs by the vector sum.
checkFreqs
data(fbiCaucs)
## induce an error
fbiCaucs$freqs[[1]] = rgamma(10,1,1)
checkFreqs(fbiCaucs)
fbiCaucs = normalizeFreqs(fbiCaucs)
checkFreqs(fbiCaucs)
Run the code above in your browser using DataLab