# NOT RUN {
# Simplest use: Just give a list of ped objects.
# To guess suitable plot window dimensions, use 'newdev = TRUE'
peds = list(nuclearPed(3), cousinPed(2), singleton(12), halfSibPed())
plotPedList(peds, newdev = TRUE)
# Modify the relative widths (which are not guessed)
widths = c(2, 3, 1, 2)
plotPedList(peds, widths = widths)
# In most cases the guessed dimensions are ok but not perfect.
# Resize plot window manually, and then plot again with `newdev = F` (default)
# plotPedList(peds, widths = widths)
## Remove frames
plotPedList(peds, widths = widths, frames = FALSE)
# Non-default frames
frames = list(1, 2:3)
plotPedList(peds, widths = widths, frames = frames,
frametitles = c('First', 'Second'))
# To give *the same* parameter to all plots, it can just be added at the end:
margins = c(2, 4, 2, 4)
title = 'Same title'
id.labels = ''
symbolsize = 1.5
plotPedList(peds, widths = widths, frames = frames, margins = margins,
title = title, id.labels = id.labels, symbolsize = symbolsize,
newdev = TRUE)
# COMPLEX EXAMPLE WITH MARKER DATA AND VARIOUS OPTIONS
# For more control of individual plots, each plot and all its parameters
# can be specified in its own list:
x1 = nuclearPed(nch = 3)
m1 = marker(x1, `3` = 1:2)
marg1 = c(7, 4, 7, 4)
plot1 = list(x1, marker = m1, margins = marg1, title = "Plot 1",
deceased = 1:2, cex = 1.3)
x2 = cousinPed(2)
m2 = marker(x2, alleles = "A")
genotype(m2, leaves(x2)) = "A"
marg2 = c(3, 4, 2, 4)
plot2 = list(x2, marker = m2, margins = marg2, title = "Plot 2", symbolsize = 1.2,
skip.empty.genotypes = TRUE, id = NULL)
x3 = singleton("Mr. X")
marg3 = c(10, 0, 0, 0)
plot3 = list(x3, margins = marg3, title = "Plot 3", symbolsize = 1, cex = 2)
x4 = halfSibPed()
shaded = 4:5
col = c("black", "black", "black", "blue", "blue")
marg4 = marg1
plot4 = list(x4, margins = marg4, title = "Plot 4", shaded = shaded, col = col)
plotPedList(list(plot1, plot2, plot3, plot4), widths = c(2,3,1,2),
frames = list(1, 2:3, 4), newdev = TRUE)
# Different example:
plotPedList(list(halfCousinPed(4), cousinPed(7)),
title = c('Many generations', 'Very many generations'),
newdev = TRUE, dev.height = 9, dev.width = 9)
# }
Run the code above in your browser using DataLab