getComponent {pedtools}R Documentation

Pedigree component

Description

Given a list of ped objects (called pedigree components), and a vector of ID labels, find the index of the component holding each individual.

Usage

getComponent(x, ids, checkUnique = FALSE, errorIfUnknown = FALSE)

Arguments

x

A ped object, or a list of such.

ids

A vector of ID labels (coercible to character).

checkUnique

A logical, by default FALSE. If TRUE, an error is raised if any element of ids occurs more than once in x.

errorIfUnknown

A logical, by default FALSE. If TRUE, the function stops with an error if not all elements of ids are found in x.

Value

An integer vector of the same length as ids, with NA entries where the corresponding label was not found in any of the components.

See Also

internalID()

Examples

x = list(nuclearPed(1), singleton(id = "A"))
getComponent(x, c(3, "A"))


[Package pedtools version 2.7.0 Index]