Skip to Content

nuclearPed {paramlink}

Create nuclear families or n-degree cousin pedigrees
Package: 
paramlink
Version: 
0.2-1

Description

These are utility functions for creating rudimentary 'linkdat' objects with common pedigree structures. The function nuclearPed creates a nuclear family with a specified number of boy/girl offspring, while cousinPed creates a pedigree linking two cousins of specified degree.

Usage

nuclearPed(boys, girls = 0)
cousinPed(degree=1)

Arguments

boys
a nonnegative integer, the number of male offspring.
girls
a nonnegative integer, the number of female offspring.
degree
an positive integer: 1=first cousins; 2=second cousins, a.s.o.

Details

All individuals are created as unaffected. Use link{modifyPedigree} to edit this (see Examples).

The function cousinPed creates pedigrees linking two male cousins with zero removal. Removals are easily contructed using link{addChild} or link{removeIndiv} (see Examples).

Values

a linkdat object.

Note

To make changes of sex/affection status, or to create cousin removals, it is often helpful to plot the pedigree.

See Also

link{modifyPedigree}, link{removeIndiv}, link{plot.pedigree}

Examples

# A nuclear family with 2 boys and 3 girls, 
# where the father and the two boys are affected.
x=nuclearPed(boys=2, girls=3)
x=modifyPedigree(x, id=c(1,3,4), attrib='AFF')
plot(x)
 
# A pedigree showing a pair of third cousins
y=cousinPed(3)
plot(y)
 
# Adding a child on one side, to create third cousins once removed. 
# The pedigree plot above helps identifying which individual 
# should have the extra child
y = addChildren(y, father=16, mother=0)
plot(y)

Author(s)

Magnus Dehli Vigeland

Documentation reproduced from package paramlink, version 0.2-1. License: GPL (>= 2)