Learn R Programming

gnonadd (version 1.0.3)

Viol.by.gen: Violin plot by genotype

Description

This tool creates violin plots corresponding to each genotype.

Usage

Viol.by.gen(qt, g, trait_name = "qt trait", title = "")

Value

A violin plot

Arguments

qt

A numeric vector.

g

An integer vector.

trait_name

A string.

title

A string.

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
Viol.by.gen(qt_vec, geno_vec)

Run the code above in your browser using DataLab