Learn R Programming

nprcgenekeepr (version 1.0.5)

meanKinship: Calculates the mean kinship for each animal in a kinship matrix

Description

Part of Genetic Value Analysis

Usage

meanKinship(kmat)

Arguments

kmat

a numeric matrix of pairwise kinship coefficients. Animal IDs are the row and column names.

Value

A named numeric vector of average kinship coefficients for each animal ID. Elements are named with the IDs from the columns of kmat.

Details

The mean kinship of animal i is $$MK_i = \Sigma f_ij / N$$, in which the summation is over all animals, j, including the kinship of animal i to itself.

Examples

Run this code
# NOT RUN {
library(nprcgenekeepr)
ped <- nprcgenekeepr::qcPed
kmat <- kinship(ped$id, ped$sire, ped$dam, ped$gen)
head(meanKinship(kmat))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab