Learn R Programming

QTLRel (version 0.2-9)

kinship: Calculate kinship coefficients

Description

Calculate kinship coefficients from a pedigree.

Usage

kinship(ped, ids)

Arguments

ped
a pedigree, which a data frame (id, sire, dam, ...). If given, "generation" can be numeric 0, 1, 2, ... or non-numeric "F0", "F1", "F2", ... If "sex" is included, male should be "M", "Male" or 1, and female should be "F", "Female" or 2 (other than 0 and 1
ids
IDs of the individuals. If given, kinship coefficients are extracted for individuals with ID ids; otherwise, kinship coefficients are provided for all individuals in the pedigree.

Value

  • A matrix giving kinship coefficients.

Examples

Run this code
data(miscEx)

id<- sample(ped$id,10)
ksp<- kinship(ped,ids=id)

Run the code above in your browser using DataLab