create.pedigree {synbreed} | R Documentation |
This function can be used to create a pedigree
object.
create.pedigree( ID, Par1, Par2, gener = NULL, sex = NULL, add.ancestors = FALSE, unknown = 0 )
ID |
vector of unique IDs identifying individuals |
Par1 |
vector of IDs identifying parent 1 (with animals: sire) |
Par2 |
vector of IDs identifying parent 2 (with animals: dam) |
gener |
vector identifying the generation. If |
sex |
vector identifying the sex (female=0 and male=1). |
add.ancestors |
|
unknown |
value for unknown or missing ancestors. |
Missing values for parents in the pedigree should be coded NA
. 0 is
treaded as unknown, too.
An object of class pedigree
. Column gener
starts from
0 and pedigree is sorted by generation.
Valentin Wimmer
# example with 9 individuals id <- paste("ID", 1:9, sep = "0") par1 <- paste("ID", c(0, 0, 0, 0, 1, 1, 1, 4, 7), sep = "") par2 <- paste("ID", c("", "", "", "", 2, 3, 2, 5, 8), sep = "") gener <- c(0, 0, 0, 0, 1, 1, 1, 2, 3) # create pedigree object (using argument gener) ped <- create.pedigree(id, par1, par2, gener, unknown = c("ID0", "ID")) ped plot(ped) # create pedigree object (without using argument gener) ped2 <- create.pedigree(id, par1, par2, unknown = c("ID0", "ID")) ped2