additive_genetic_competition: Build an additive-genetic competition model

Description Usage Arguments Details Value Examples

View source: R/genetic.R

Description

Return incidence and structure for a additive_genetic_competition model, given the pedigree, the spatial coordinates and codes of the observations and the competition decay parameter.

Usage

1
additive_genetic_competition(pedigree, coordinates, id, decay, autofill = TRUE)

Arguments

pedigree

object of class 'pedigree'

coordinates

two-column matrix-like set of row and column coordinates of observational units

id

integer vector of numeric codes for observed individuals

decay

numeric. The positive value of the decay parameter α. Typically 1 or 2. See Details.

autofill

logical. If TRUE (default) it will try to fill missing rows or columns with missing observations. Otherwise, will treat individuals as neighbours even if they are across an empty line.

Details

id must hold the codes of observed individuals in the original codification. If recoding took place when building the pedigree, this function will handle the codes internally.

Value

A list with elements pedigree, incidence.matrix, structure.matrix and structure.type, which is a string indicating either covariance or precision.

Examples

1
2
3
4
5
6
7
dat <- data.frame(id   = 1:5,
                  sire = c(11, 11, 2, 3, 2),
                  dam  = c(12, NA, 1, 12, 1),
                  x    = c(rep(1:2, times = 2), 3),
                  y    = c(rep(1:2, each = 2), 3))
ped <- build_pedigree(1:3, data = dat)
breedR:::additive_genetic_competition(ped, coord = dat[, c('x', 'y')], dat$id, 2)

famuvie/breedR documentation built on Sept. 6, 2021, 4:50 a.m.