Learn R Programming

pedtools (version 2.8.0)

validatePed: Pedigree errors

Description

Validate the internal pedigree structure. The input may be either a (possibly malformed) ped() object, or its defining vectors id, fid, mid, sex.

Usage

validatePed(x = NULL, id = NULL, fid = NULL, mid = NULL, sex = NULL)

Value

If no errors are detected, the function returns NULL invisibly. Otherwise, messages describing the errors are printed to the screen and an error is raised.

Arguments

x

A ped object.

id

A vector (coercible to character) of individual ID labels.

fid, mid

Vectors of the same length as id, naming the father and mother of each individual, respectively. Missing parents (i.e., corresponding to founder individuals) may be entered as "0", "" or NA.

sex

A numeric of the same length as id, describing the genders of the individuals (in the same order as id.) Each entry must be either 1 (=male), 2 (=female) or 0 (=unknown).

Examples

Run this code
x = nuclearPed()
validatePed(x)

# Various errors
# validatePed(id = c(1,2), fid = c(2,0), mid = c(0,1), sex = c(1,2))

Run the code above in your browser using DataLab