Learn R Programming

solarius (version 0.3.0.2)

plotKinship2: Plot the double kinship matrix

Description

The main function that calls imageKinship2 or histKinship2 depending on value of y argument.

Usage

plotKinship2(x, y = c("image", "hist"))
imageKinship2(x)
histKinship2(x)

Arguments

x
A square matrix of double kinship coefficients.
y
A character, the type of the plot. Possible values are "image" and "hist". The default value is "image".

Details

imageKinship2 function calls image function from Matrix package.

histKinship2 function plots a histogram based on ggplot2 package.

Examples

Run this code
# load `kin` kinship matrix from `dat50` data set
data(dat50)
kin2 <- 2* kin # double kinship matrix

plotKinship2(kin2) # equivalent to `imageKinship2(kin2)`

plotKinship2(kin2, "hist") # equivalent to `histKinship2(kin2)`

Run the code above in your browser using DataLab