Learn R Programming

synbreed (version 0.9-2)

create.pedigree: Create pedigree object

Description

This function can be used to create a pedigree object.

Usage

create.pedigree(ID, Par1, Par2, gener=NULL,sex=NULL,add.ancestors=FALSE)

Arguments

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 NULL gener will be 0 for unknown parents and max(gener(Par1),gener(Par2))+1 for generations 1,... .
sex
vector identifying the sex (female=0 and male=1).
add.ancestors
logical. Add ancestors which do not occur in ID to the pedigree.

Value

  • An object of class pedigree. Column gener starts from 0 and pedigree is sorted by generation.

Details

Missing values for parents in the pedigree should be coded with 0 for numeric ID or NA for character ID.

See Also

plot.pedigree

Examples

Run this code
# example with 9 individuals        
id <- 1:9
par1 <- c(0,0,0,0,1,1,1,4,7)
par2 <- c(0,0,0,0,2,3,2,5,8)
gener <- c(0,0,0,0,1,1,1,2,3)

# create pedigree object (using argument gener)
ped <- create.pedigree(id,par1,par2,gener)
ped
plot(ped)

# create pedigree object (without using argument gener)
ped2 <- create.pedigree(id,par1,par2)
ped2

Run the code above in your browser using DataLab