############
# Example 1: Merge 2 trios by fusing the fathers
x1 = x2 = nuclearPed()
x = mergePed(x1, x2, by = c("1" = "1"))
plot(x)
##################################
# Example 2: Double first cousins
##################################
# First cousins, whose fathers are brothers
y = cousinPed(degree = 1)
# Create two sisters
sisters = nuclearPed(2, sex = 2)
# Plot to see who is who: `plot(list(y, sisters))`
# Merge
z = mergePed(y, sisters, by = c("4" = 3, "6" = 4), relabel = TRUE)
plot(z)
Run the code above in your browser using DataLab