normalizeFreqs {relSim}R Documentation

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)

Arguments

Freqs

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

Details

Divides vector in Freqs$freqs by the vector sum.

Value

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

Author(s)

James M. Curran

See Also

checkFreqs

Examples


data(fbiCaucs)

## induce an error
fbiCaucs$freqs[[1]] = rgamma(10,1,1)
checkFreqs(fbiCaucs)
fbiCaucs = normalizeFreqs(fbiCaucs)
checkFreqs(fbiCaucs)


[Package relSim version 1.0.0 Index]