geom_locus: Translate a vector of 'locus' objects into a 'gemo_bars'...

View source: R/geom_locus.R

geom_locusR Documentation

Translate a vector of locus objects into a gemo_bars layer

Description

This function takes a data frame containing genetic data and returns a geom_bars layer for ggplot integration.

Usage

geom_locus(mapping, data, ...)

Arguments

mapping

The aesthetic mapping (e.g., which locus to use). Use aes(x=LOCUS_NAME) to specify which locus is being used.

data

A data.frame containing one or more loci to be plot

...

Added to geom_bar

Value

A formatted set of ggplot objects to be plot

Note

If using more than one stratum, use fill=STRATA_NAME for partitioning

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

require(ggplot2)
loci <- c( locus(1:2), locus(2:3), locus(c(1,1)), locus(1:2) )
data <- data.frame( Population=c("A","A","B","B"), Locus=loci)
ggplot() + geom_locus( aes(x=Locus, fill=Population), data=data )

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.