# NOT RUN {
x = nuclearPed(father = "fa", mother = "mo", child = "boy")
m = marker(x, fa = "1/1", boy = "1/2", name = "SNP")
plot(x, marker = m)
# Markers attached to `x` may be called by name
x = setMarkers(x, m)
plot(x, marker = "SNP")
# Other options
plot(x, marker = "SNP", hatched = typedMembers(x),
starred = "fa", deceased = "mo")
# Filled symbols
plot(x, aff = males(x))
# Label only some members
plot(x, labs = c("fa", "boy"))
# Label only some members; rename the father
plot(x, labs = c(FATHER = "fa", "boy"))
# Label males only
plot(x, labs = males)
# Colours
plot(x, col = list(red = "fa", green = "boy"), hatched = "boy")
# Founder inbreeding is shown by default
founderInbreeding(x, "mo") = 0.1
plot(x)
# ... but can be suppressed
plot(x, fouInb = NULL)
# Twins
x = nuclearPed(children = c("tw1", "tw2", "tw3"))
plot(x, twins = data.frame(id1 = "tw1", id2 = "tw2", code = 1)) # MZ
plot(x, twins = data.frame(id1 = "tw1", id2 = "tw2", code = 1)) # DZ
# Triplets
plot(x, twins = data.frame(id1 = c("tw1", "tw2"),
id2 = c("tw2", "tw3"),
code = 2))
#-----------------------------
# In some cases, the plotting machinery of `kinship2` needs a hint
# (see ?kinship2::align.pedigree)
# Example with 3/4-siblings
y = nuclearPed(2)
y = addChildren(y, 3, mother = 5, nch = 1)
y = addChildren(y, 4, mother = 5, nch = 1)
plot(y) # bad
hints = list(order = 1:7, spouse = rbind(c(3,5,0), c(5,4,0)))
plot(y, hints = hints) # good
# }
Run the code above in your browser using DataLab