showInTriangle: Add points to the IBD triangle

View source: R/ibdTriangle.R

showInTriangleR Documentation

Add points to the IBD triangle

Description

Utility function for plotting points in the IBD triangle.

Usage

showInTriangle(
  kappa,
  new = TRUE,
  col = 6,
  cex = 1,
  pch = 4,
  lwd = 2,
  labels = FALSE,
  colLab = col,
  cexLab = 0.8,
  pos = 1,
  adj = NULL,
  keep.par = TRUE,
  ...
)

Arguments

kappa

Coordinates of points to be plotted in the IBD triangle. Valid input types are:

  • A numerical vector of length 2 or 3. In the latter case kappa[c(1, 3)] is used.

  • A matrix of data frame, whose column names must include either k0 and k2, kappa0 and kappa2, or ibd0 and ibd2.

  • A list (and not a data frame), in which case an attempt is made to bind the elements row-wise.

new

A logical indicating if a new triangle should be drawn.

col, cex, pch, lwd

Parameters passed onto points().

labels

A character of same length as the number of points, or a single logical TRUE or FALSE. If TRUE, an attempt is made to create labels by pasting columns ID1 and ID2 in kappa, if these exist. By default, no labels are plotted.

colLab, cexLab, pos, adj

Parameters passed onto text() (if labels is non-NULL).

keep.par

A logical. If TRUE, the graphical parameters are not reset after plotting, which may be useful for adding additional annotation.

...

Plot arguments passed on to ibdTriangle().

Value

None

Author(s)

Magnus Dehli Vigeland

Examples

showInTriangle(c(3/8, 1/8), label = "3/4 siblings", pos = 1)


ribd documentation built on Aug. 10, 2023, 5:08 p.m.