# construct a family with three founders, but one "bob" has no descendants
library(tibble)
fam <- tibble(
id = c('mom', 'dad', 'bob', 'child'),
pat = c( NA, NA, NA, 'dad'),
mat = c( NA, NA, NA, 'mom')
)
# only want 'child' and its ancestors
ids <- 'child'
fam2 <- prune_fam( fam, ids )
# the filtered pedigree has "bob" removed:
fam2
Run the code above in your browser using DataLab