R functions related to pedigrees