extractSingletons: Extract singletons from pedigree

View source: R/ped_subgroups.R

extractSingletonsR Documentation

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)

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.

Value

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

Examples


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)



pedtools documentation built on Nov. 5, 2025, 5:50 p.m.