# A nuclear family with 2 boys and 3 girls,
# where the father and the two boys are affected.
x = nuclearPed(noffs=5, sex=c(1,1,2,2,2))
x = swapAff(x, ids=c(1,3,4))
# 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 = addOffspring(y, father=15, noffs=1)
# Half sibs:
z = halfCousinPed(0)
# Alternative construction:
z2 = nuclearPed(noffs=1, sex=1)
z2 = addOffspring(z2, father=1, noffs=1, sex=2)
z2 = relabel(z2, new=1:5,old=c(1,2,4,3,5))
stopifnot(all.equal(z,z2))
Run the code above in your browser using DataLab