alignped2: Second routine alignement

View source: R/alignped2.R

alignped2R Documentation

Second routine alignement

Description

This is the second of the four co-routines.

Usage

alignped2(x, dad, mom, level, horder, packed, spouselist)

Arguments

spouselist

Details

This routine takes a collection of siblings, grows the tree for each, and appends them side by side into a single tree. The input arguments are the same as those to alignped1 with the exception that [[x]] will be a vector. This routine does nothing to the spouselist matrix, but needs to pass it down the tree and back since one of the routines called by alignped2 might change the matrix.

The code below has one non-obvious special case. Suppose that two sibs marry. When the first sib is processed by alignped1 then both partners (and any children) will be added to the rval structure below. When the second sib is processed they will come back as a 1 element tree (the marriage will no longer be on the spouselist), which should be added onto rval. The rule thus is to not add any 1 element tree whose value (which must be x[i]) is already in the rval structure for this level.

Value

A set of matrices along with the spouselist matrix. The latter has marriages removed as they are processed.

See Also

plot.pedigree, autohint

Examples

data(sample.ped)
ped <- with(sample.ped,pedigree(id, father, mother, sex, affected))
align.pedigree(ped)


sinnweja/kinship2 documentation built on July 8, 2023, 11:26 p.m.