Learn R Programming

optiSel (version 0.9.1)

noffspring: Calculates Optimum Numbers of Offspring

Description

Calculates the optimum numbers of offspring from optimum contributions of selection candidates.

Usage

noffspring(cand, N)

Arguments

cand

Data frame with optimum contributions (column oc), sexes (column Sex), and IDs (column Indiv) of the selection candidates.

N

Desired number of individuals in the offspring population.

Value

Data frame with column Indiv containing the individual IDs and integer column nOff containing the optimum numbers of offspring. This column is approximately 2*N*cand$oc with sum(noff[cand$Sex=="male"])=N and sum(noff[cand$Sex=="female"])=N.

Details

The function calculates the optimum numbers of offspring of the selection candidates from the optimum contributions cand$oc and the size N of the offspring population.

Examples

Run this code
# NOT RUN {
data(PedigWithErrors)
data(Phen)

keep  <- Phen$Indiv
Pedig <- prePed(PedigWithErrors, keep=keep, thisBreed="Hinterwaelder", lastNative=1970)
Kin   <- kinlist(fA=pedIBD(Pedig, keep.only=keep))
con   <- list(ub.fA=0.03, ub=c(M=NA, F=-1))
maxBV <- opticont("max.BV", K=Kin, phen=Phen, con=con, trace = FALSE)
summary(maxBV)

N <- 150
cand <- maxBV$parent
cand$nOff <- noffspring(cand, N)$nOff

sum(cand$nOff[cand$Sex=="male"])
#[1] 150

sum(cand$nOff[cand$Sex=="female"])
#[1] 150

round(2*N*cand$oc-cand$nOff, 2)
# }

Run the code above in your browser using DataLab