Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

relSim (version 1.0.0)

normalizeFreqs: Normalize frequencies to 1

Description

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.

Usage

normalizeFreqs(Freqs)

Value

A list containg elements loci and freqs. freqs

is a list of vectors containing the frequencies at the given loci.

Arguments

Freqs

A list containg elements loci and freqs. freqs is a list of vectors containing the frequencies at the given loci.

Author

James M. Curran

Details

Divides vector in Freqs$freqs by the vector sum.

See Also

checkFreqs

Examples

Run this code

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