Learn R Programming

MasterBayes (version 2.58)

orderPed: Orders a Pedigree

Description

Orders a pedigree so parents come before offspring

Usage

orderPed(ped, time_born=NULL)

Arguments

ped

pedigree with id, dam and sire in ech column

time_born

an optional vector of birth dates by which the pedigree can be ordered)

Value

an ordered pedigree pedigree with id, dam and sire in each column

See Also

MCMCped

Examples

Run this code
# NOT RUN {
pedigree<-matrix(NA, 8,3)
pedigree[,1]<-1:8
pedigree[,2][5:8]<-c(1,1,2,2)
pedigree[,3][5:8]<-c(3,3,4,4)

pedigree<-pedigree[sample(1:8),]

pedigree2<-orderPed(pedigree)
# }

Run the code above in your browser using DataLab