plot_density: Plot density across loci

View source: R/plot_density.R

plot_densityR Documentation

Plot density across loci

Description

Plots histograms of a genetic variable across loci at a specific time point, facetted by trait and with the variable on the y-axis.

Usage

plot_density(data, variable, time, bins = 20)

Arguments

data

A data frame with locus-specific data (see ?read_loci)

variable

Name of the variable to plot (a string)

time

Time point at which to show the variable

bins

Parameter to be passed to ggplot2::geom_histogram

Value

A ggplot

See Also

read_loci, ggplot2::geom_histogram

Examples


## Not run: 

root <- system.file("extdata", "sim-example", package = "speciomer")
data <- read_loci(root, "locus_Fst")
plot_density(data, "Fst", time = -1000)


## End(Not run)


rscherrer/speciomer documentation built on March 11, 2023, 5:37 p.m.