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

mergePed

Merge two pedigrees


Description

This function merges two ped objects, joining them at the individuals with equal ID labels. This is especially useful for building 'top-heavy' pedigrees. Only ped objects without marker data are supported.

Usage

mergePed(x, y, ...)

Arguments

x, y

ped() objects

...

further arguments passed along to ped(), e.g. famid, validate and reorder.

Value

A ped object.

Author(s)

Magnus Dehli Vigeland

Examples

# Creating a trio where each parent have first cousin parents.
# (Alternatively, this could be built using many calls to addParents().)

# Paternal family
x = cousinPed(1, child = TRUE)
x = addSon(x, 9)

# Maternal family
y = cousinPed(1, child = TRUE)
y = relabel(y, c(101:108, 10))
y = swapSex(y, 10)

# Joining x and y at the common individuals (in this case: `10`)
z = mergePed(x, y)

# Plot all three pedigrees
opar = par(mfrow = c(1, 3))
plot(x); plot(y); plot(z, col = list(red = labels(y)))

# Reset graphical parameters
par(opar)

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.