hist_by_gen {gnonadd}R Documentation

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)
)

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.

Value

A histgram plot

Examples

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)

[Package gnonadd version 1.0.2 Index]