Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getComponent

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 list of ped objects

ids

A vector of ID labels (coercible to character)

checkUnique

If TRUE an error is raised if any element of ids occurs more than once in x. Default: FALSE.

errorIfUnknown

If TRUE, the function stops with an error if not all elements of ids are recognised as names of members in x. Default: FALSE.

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

Examples

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

pedtools

Creating and Working with Pedigrees and Marker Data

v0.9.7
GPL-3
Authors
Magnus Dehli Vigeland [aut, cre] (<https://orcid.org/0000-0002-9134-4962>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.