trophicDensityPlot | R Documentation |
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.
trophicDensityPlot(df = NULL, quantiles = FALSE, grouped = TRUE)
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. |
a ggplot2::ggplot object
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.