Learn R Programming

kinship2 (version 1.9.6.1)

legendPlot: Legend Pedigree Plot

Description

Pedigree plot with ready-made legend along the bottom of the page to represent colors and affection statuses

Usage

legendPlot(
  x,
  id = x$id,
  affected = x$affected,
  affected.label = NULL,
  col = 1,
  col.label = NULL,
  symbolsize = 0.75,
  cex = 0.5,
  ...
)

Arguments

x

Pedigree data frame with ped (pedigree id), id (id of individual), father (id of father), mother (id of mother), sex, affected (affection status), and avail (DNA availability).

id

Optional, a character string to replace the correspinding id for persons in the pedigree

affected

A variable indicating affection status. A multi-column matrix can be used to give the status with respect to multiple traits. Logical, factor, and integer types are converted to 0/1 representing unaffected and affected, respectively. NAs are considered missing.

affected.label

Set labels for affection statuses

col

Colors for the plot symbol for each individual

col.label

Named vector, with elements matching the unique color codes, the names are the labels used in the legend.

symbolsize

Size of symbols (circle/square/triangle). Default is 1.0

cex

Character expansion size for labels and ids. Default is 1.0

...

Character expansion size for labels and ids. Default is 1.0

Author

Jason Sinnwell, code contributed by Sara Achenbach

See Also

pedigree, plot.pedigree

Examples

Run this code
if (FALSE) {
data(sample.ped)
pedAll <- pedigree(sample.ped$id, sample.ped$father,
   sample.ped$mother, sample.ped$sex,
   affected=cbind(sample.ped$affected, sample.ped$avail),
   famid=sample.ped$ped)
ped1 <- pedAll["1"]
legendPlot(ped1,  affected.label=c("cancer","available"))
}

Run the code above in your browser using DataLab