subPed {optiSel}R Documentation

Creates a Subset of a Large Pedigree

Description

Creates a subset of a large pedigree that includes only individuals related with specified individuals in a predefined way.

Usage

subPed(Pedig, keep, prevGen=3, succGen=0)

Arguments

Pedig

Data frame containing the pedigree where the first 3 columns correspond to: Individual ID, Sire, and Dam. More columns can be passed in the Pedig argument including columns named Sex, Breed (with breed names), and Born (with years of birth). Missing parents are coded as NA, 0, or "0".

keep

Vector with IDs of individuals. Only these individuals and individuals related with them in a predefined way will be kept in the pedigree.

prevGen

Number of previous (ancestral) generations to be included in the pedigree.

succGen

Number of succeeding (descendant) generations to be included in the pedigree.

Details

This function creates a subset of a large pedigree that includes only individuals related with the individuals specified in the vector keep in a predefined way.

Value

A data frame containing the reduced pedigree. A column keep is appended indicating which individuals were included in parameter keep.

Author(s)

Robin Wellmann

Examples


data(PedigWithErrors)

sPed <- subPed(PedigWithErrors, keep="276000891974272", prevGen=3, succGen=2)
sPed

label <- c("Indiv", "Born", "Breed")
pedplot(sPed, mar=c(2,4,2,4), label=label, cex=0.7)


[Package optiSel version 2.0.9 Index]