Learn R Programming

evola (version 1.0.7)

freqPosAllele: Extract frequency of positive alleles

Description

Computes the frequency of positive alleles given certain marker effects.

Usage

freqPosAllele(M, alpha)

Value

$res

a matrix

Arguments

M

Marker matrix.

alpha

Vector of marker effects.

Details

A simple apply function to compute the frequency of the positive alleles.

References

Giovanny Covarrubias-Pazaran (2024). evola: a simple evolutionary algorithm for complex problems. To be submitted to Bioinformatics.

See Also

evolafit -- the core function of the package

Examples

Run this code

#random population of 10 lines with 5 markers
M <- matrix(rep(0,10*5),10,5)
for (i in 1:10) {
  M[i,] <- ifelse(runif(5)<0.5,0,2)
}
alpha <- sample(c(-1,1),5, replace=TRUE)

freqPosAllele(M, alpha)

Run the code above in your browser using DataLab