add.pedigree: Merge 'pedigree' object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/add.pedigree.r

Description

This function can be used to add some pedigree information to a existing pedigree object.

Usage

1
add.pedigree(ped, IDadd, add.ancestors = FALSE)

Arguments

ped

pedigree object

IDadd

pedigree object

add.ancestors

logical. Add ancestors which do not occur in ID to the pedigree.

Details

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

Value

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

Author(s)

Hans-Juergen Auinger

See Also

plot.pedigree, create.pedigree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# example with 9 individuals
id <- paste("ID", 1:9, sep = "0")
par1 <- paste("ID", c("", "", "", "", 1, 1, 1, 4, 7), sep = "0")
par2 <- paste("ID", c("", "", "", "", 2, 3, 2, 5, 8), sep = "0")
ped1 <- create.pedigree(id, par1, par2, unknown = "ID0")

# create 2nd pedigree object
Id <- paste("ID", 10:16, sep = "")
Par1 <- paste("ID", c("", "", 1, 1, 6, 7, 7), sep = "0")
Par2 <- paste("ID", c("", "", 10, "08", "09", 11, 14), sep = "")
ped2 <- create.pedigree(Id, Par1, Par2, unknown = c("ID0", "ID"))
ped2

ped <- add.pedigree(ped1, ped2)
ped

synbreed documentation built on March 12, 2021, 3:01 a.m.