Learn R Programming

pedtools (version 2.9.0)

extractSingletons: Extract singletons from pedigree

Description

Extract one or more individuals from a pedigree, returning a list of singletons. Marker data and founder inbreeding (if present) are preserved.

Usage

extractSingletons(x, ids = NULL, simplify1 = TRUE, keepFI = TRUE)

Value

A list of singletons. If length(ids) == 1 and simplify1 = TRUE, a single singleton object is returned instead.

Arguments

x

A ped object or a list of such.

ids

A vector of ID labels (coercible to character). If empty, all individuals are extracted.

simplify1

A logical indicating if the output should be simplified to a singleton object (i.e., removing the outer list structure) if ids has length 1.

keepFI

A logical indicating if founder inbreeding should be preserved, if present.

Examples

Run this code

x = nuclearPed() |> addMarker(geno = c("1/1", NA, "1/2"))

# Extract father and child
extractSingletons(x, ids = c(1,3))

# Extract all members
extractSingletons(x)


Run the code above in your browser using DataLab