Learn R Programming

gnonadd (version 1.0.3)

hist_by_gen: Histogram by genotype

Description

This tool creates three histogram plots. One per genotype. Additionally, outliers are colored red (by default subjects that are in the top and bottom 2.5 and blue lines are added to indicate the mean and (by default) one standard deviation in each direction.

Usage

hist_by_gen(
  qt,
  g,
  bins = 100,
  trait_name = "qt trait",
  title = "",
  outlier_quantiles = c(0.025, 0.975),
  sd_lines = c(1, 1)
)

Value

A histgram plot

Arguments

qt

A numeric vector.

g

An integer vector.

bins

An integer.

trait_name

A string.

title

A string.

outlier_quantiles

A vector with length 2.

sd_lines

A vector with length 2.

Examples

Run this code
n_val <- 50000L
geno_vec <- sample(c(0, 1, 2), size = n_val, replace = TRUE)
qt_vec <- rnorm(n_val) * (1.3^geno_vec) + 1 * geno_vec
hist_by_gen(qt_vec, geno_vec)

Run the code above in your browser using DataLab