Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.survDataCstExp

Plotting method for survData objects


Description

This is the generic plot S3 method for the survData class. It plots the number of survivors as a function of time.

Usage

## S3 method for class 'survDataCstExp'
plot(
  x,
  xlab = "Time",
  ylab = "Number of survivors",
  main = NULL,
  concentration = NULL,
  style = "ggplot",
  pool.replicate = FALSE,
  addlegend = FALSE,
  remove.someLabels = FALSE,
  ...
)

Arguments

x

an object of class survData

xlab

a label for the X-axis, by default Time

ylab

a label for the Y-axis, by default Number of survivors

main

main title for the plot

concentration

a numeric value corresponding to some concentration(s) in data. If concentration = NULL, draws a plot for each concentration

style

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

pool.replicate

if TRUE, the datapoints of each replicate are summed for a same concentration

addlegend

if TRUE, adds a default legend to the plot

remove.someLabels

if TRUE, removes 3/4 of X-axis labels in 'ggplot' style to avoid label overlap

...

Further arguments to be passed to generic methods

Note

When style = "ggplot" (default), the function calls function ggplot and returns an object of class ggplot.

Examples

# (1) Load the data
data(zinc)
zinc <- survData(zinc)

# (2) Plot survival data with a ggplot style
plot(zinc)

# (3) Plot the survival data for one specific concentration
plot(zinc, concentration = 0.66)

morse

Modelling Tools for Reproduction and Survival Data in Ecotoxicology

v3.3.1
GPL (>= 2)
Authors
Virgile Baudrot [aut], Sandrine Charles [aut], Marie Laure Delignette-Muller [aut], Wandrille Duchemin [ctb], Benoit Goussen [ctb], Nils Kehrein [ctb], Guillaume Kon-Kam-King [ctb], Christelle Lopes [ctb], Philippe Ruiz [aut], Alexander Singer [ctb], Philippe Veber [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.