Learn R Programming

synbreed (version 0.12-9)

plot.relationshipMatrix: Heatmap for relationship Matrix

Description

Visualization for objects of class relationshipMatrix using a heatmap of pairwise relatedness coefficients.

Usage

# S3 method for relationshipMatrix
plot(x, y=NULL, levelbreaks=NULL, axes=TRUE, cols=NULL, groupLines = NULL, …)

Arguments

x

Object of class relationshipMatrix

y

Optional for comparisons of objects of class relationshipMatrix

levelbreaks

list with one element for x andy. Define breaks in the color scheme of the plot. If you make to many breaks, the color scheme repeats! If y=NULL this can be an vector. If you like to have the same breaks or both relationship matrices, you can also use just one vector.

axes

a logical value indicating whether axes should be drawn on the plot. Default is TRUE.

cols

a list with one element for each relationship matrix. Colors and the number of levelbreaks should fit. But also if not, a plot is drawn. In case option y=NULL, cols can bei a vector.

groupLines

add positions to make groups more visible

further graphical arguments passed to function levelplot in package lattice. To create equal colorkeys for two heatmaps, use at=seq(from,to,length=9).

Examples

Run this code
# NOT RUN {
# small pedigree
ped <- simul.pedigree(gener=4,7)
gp <- create.gpData(pedigree=ped)
A <- kin(gp,ret="add")
plot(A)

# big pedigree
# }
# NOT RUN {
library(synbreedData)
data(maize)
K <- kin(maize,ret="kin")
U <- kin(codeGeno(maize),ret="realized")/2
# equal colorkeys
plot(K,levelbreaks=seq(0,2,length=9))
plot(U,levelbreaks=seq(0,2,length=9))
# }

Run the code above in your browser using DataLab