plotKinship2: Plot the double kinship matrix

Description Usage Arguments Details Examples

View source: R/plot.lib.R

Description

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

Usage

1
2
3
4
5
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

1
2
3
4
5
6
7
# 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)`

Example output

`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

solarius documentation built on May 2, 2019, 2:43 a.m.