plot.reproFitTT: Plotting method for 'reproFitTT' objects

View source: R/plot.reproFitTT.R

plot.reproFitTTR Documentation

Plotting method for reproFitTT objects

Description

This is the generic plot S3 method for the reproFitTT class. It plots the concentration-effect fit under target time reproduction analysis.

Usage

## S3 method for class 'reproFitTT'
plot(
  x,
  xlab = "Concentration",
  ylab = "Nb of offspring per ind/day",
  main = NULL,
  fitcol = "orange",
  fitlty = 1,
  fitlwd = 1,
  spaghetti = FALSE,
  cicol = "orange",
  cilty = 2,
  cilwd = 1,
  ribcol = "grey70",
  addlegend = FALSE,
  log.scale = FALSE,
  style = "ggplot",
  ...
)

Arguments

x

an object of class reproFitTT

xlab

a label for the X-axis, by default Concentration

ylab

a label for the Y-axis, by default Nb of offspring per ind/day

main

main title for the plot

fitcol

color of the fitted curve

fitlty

line type of the fitted curve

fitlwd

width of the fitted curve

spaghetti

if TRUE, the credible interval is represented by multiple curves

cicol

color of the 95 % credible limits

cilty

line type of the 95 % credible limits

cilwd

width of the 95 % credible limits

ribcol

color of the ribbon between lower and upper credible limits. Transparent if NULL

addlegend

if TRUE, adds a default legend to the plot

log.scale

if TRUE, displays X-axis in log-scale

style

graphical backend, can be 'ggplot' or 'generic'

...

Further arguments to be passed to generic methods

Details

The fitted curve represents the estimated reproduction rate at the target time as a function of the chemical compound concentration. The function plots 95% credible intervals for the estimated reproduction rate (by default the grey area around the fitted curve). Typically a good fit is expected to display a large overlap between the two types of intervals. If spaghetti = TRUE, the credible intervals are represented by two dotted lines limiting the credible band, and a spaghetti plot is added to this band. It consists of the representation of simulated curves using parameter values sampled in the posterior distribution (10% of the MCMC chains are randomly taken for this sample).

Value

a plot of class ggplot

Note

When style = "generic", the function calls the generic function plot

When style = "ggplot", the function return an object of class ggplot, see function ggplot

Examples


# (1) Load the data
data(cadmium1)

# (2) Create an object of class "reproData"
dataset <- reproData(cadmium1)


# (3) Run the reproFitTT function with the log-logistic gamma-Poisson model
out <- reproFitTT(dataset, stoc.part = "gammapoisson",
                  ecx = c(5, 10, 15, 20, 30, 50, 80), quiet = TRUE)


# (4) Plot the fitted curve with generic style
plot(out, xlab = expression("Concentration in" ~ mu~g.L^{-1}),
     fitcol = "blue", cicol = "lightblue",
     main = "Log-logistic response to concentration")



morse documentation built on Oct. 29, 2022, 1:14 a.m.