trophicDensityPlot: Function to plot posterior samples of trophic position...

Description Usage Arguments Value Examples

Description

This function receives a data frame with sampled posterior trophic position estimates. The user may set if he/she wants quantiles to be plotted, in which case the 95 can states whether he/she wants the density plots grouped or not. For visualization purposes, density functions look better if they are not grouped, when quantiles are added.

Usage

1
trophicDensityPlot(df = NULL, quantiles = FALSE, grouped = TRUE)

Arguments

df

data frame with 2 variables: "TP" and "Species". TP can be posterior samples of trophic position and Species must be a factor.

quantiles

logical variable. If TRUE 95 distribution, plus mean and median are added to the plot.

grouped

logical variable. If TRUE trophic position density plots are grouped.

Value

a ggplot2::ggplot object

Examples

1
2
3
4
5
6
7
species1 <- stats::rnorm(1000, 4, 0.1)
species2 <- stats::rnorm(1000, 3, 0.8)
TP <- c(species1, species2)
Species <- c(rep("Species 1", length(species1)),
rep("Species 2", length(species2)))
df <- data.frame(TP, Species)
trophicDensityPlot(df)

Example output

This is tRophicPosition 0.7.7

tRophicPosition documentation built on May 2, 2019, 4:15 a.m.