Learn R Programming

pedtools (version 1.1.0)

founderInbreeding: Inbreeding coefficients of founders

Description

Functions to get or set inbreeding coefficients for the pedigree founders.

Usage

founderInbreeding(x, ids, named = FALSE, chromType = "autosomal")

founderInbreeding(x, ids, chromType = "autosomal") <- value

Arguments

x

A ped object.

ids

Any subset of founders(x). If ids is missing in founderInbreeding(), it is set to founders(x).

named

A logical: If TRUE, the output vector is named with the ID labels.

chromType

Either "autosomal" (default) or "x".

value

A numeric of the same length as ids, entries in the interval [0, 1]. If the vector is named, then the names are interpreted as ID labels of the founders whose inbreeding coefficients should be set. In this case, the ids argument should not be used. (See examples.)

Value

For founderInbreeding, a numeric vector of the same length as ids, containing the founder inbreeding coefficients.

For founderInbreeding<- the updated ped object is returned.

Examples

Run this code
# NOT RUN {
x = nuclearPed(father = "fa", mother = "mo", child = 1)
founderInbreeding(x, "fa") = 1
founderInbreeding(x, named = TRUE)

# Setting all founders at once (replacement value is recycled)
founderInbreeding(x, ids = founders(x)) = 0.5
founderInbreeding(x, named = TRUE)

# Alternative syntax, using a named vector
founderInbreeding(x) = c(fa = 0.1, mo = 0.2)
founderInbreeding(x, named = TRUE)

# }

Run the code above in your browser using DataLab