Learn R Programming

kinship2 (version 1.3.1)

pedigree: Create pedigree structure

Description

Create pedigree structure in the format needed for plotting.

Usage

pedigree(id, dadid, momid, sex, affected, status, relation, famid,
missid)

Arguments

id
Identification variable for individual
dadid
Identification variable for father. Founders' parents should be coded to NA, or another value specified by missid.
momid
Identification variable for mother. Founders' parents should be coded to NA, or another value specified by missid.
sex
Gender of individual noted in `id'. Either character ("male","female","unknown","terminated") or numeric (1="male", 2="female", 3="unknown", 4="terminated") data is allowed. For character data the string may be truncated, and of arbitrary case.
affected
A variable indicating affection status. A multi-column matrix can be used to give the status with respect to multiple traits. Logical, factor, and integer types are converted to 0/1 representing unaffected and affected, respectively. NAs are not al
status
Status (0="censored", 1="dead")
relation
A matrix with 3 columns (id1, id2, code) specifying special relationship between pairs of individuals. Codes: 1=Monozygotic twin, 2=Dizygotic twin, 3=Twin of unknown zygosity, 4=Spouse. (The last is necessary in order to place a marriage with no children
famid
An optional vector of family identifiers. If it is present the result will contain individual pedigrees for each family in the set, which can be extacted using subscripts. Individuals need to have a unique id within family.
missid
The founders are those with no father or mother in the pedigree. The dadid and momid values for these subjects will either be NA or the value of this variable. The default for missid is 0 if the id

Value

  • An object of class pedigree or pedigreeList Containing the following items: famid id findex mindex sex affected status relation

See Also

plot.pedigree, autohint

Examples

Run this code
data(minnbreast)

bpeds <- with(minnbreast,
    pedigree(id, fatherid, motherid, sex, affected=proband, famid=famid))

## pedigree with id=8
bped.id8 <- bpeds['8']

print(bped.id8)

plot(bped.id8)

## the 8th pedigree
bped8 <- bpeds[8]

print(bped8)

plot(bped8)

Run the code above in your browser using DataLab