plot.trim.totals: Plot time-totals from trim output.

View source: R/trim_post.R

plot.trim.totalsR Documentation

Plot time-totals from trim output.

Description

This function plots a time series of one or more trim.totals objects, i.e. the output of totals. Both the time totals themselves, as the associated standard errros will be plotted, the former as a solid line with markers, the latter as a transparent band.

Usage

## S3 method for class 'trim.totals'
plot(
  x,
  ...,
  names = NULL,
  xlab = "auto",
  ylab = "Time totals",
  leg.pos = "topleft",
  band = "se"
)

Arguments

x

an object of class trim.totals, as resulting from e.g. a call to totals.

...

optional additional trim.totals objects.

names

optional character vector with names for the various series.

xlab

x-axis label. The default value of "auto" will be changed into "Year" or "Time Point", whichever is more appropriate.

ylab

y-axis label.

leg.pos

legend position, similar as in legend.

band

Defines if the uncertainty band will be plotted using standard errors ("se") or confidence intervals ("ci").

Details

Additionally, the observed counts will be plotted (as a line) when this was asked for in the call to totals.

Multiple time-total data sets can be compared in a single plot

See Also

Other graphical post-processing: heatmap(), plot.trim.index()

Examples


# Simple example
data(skylark2)
z <- trim(count ~ site + year, data=skylark2, model=3)
plot(totals(z))

# Extended example
z1 <- trim(count ~ site + year + habitat, data=skylark2, model=3)
z2 <- trim(count ~ site + year, data=skylark2, model=3)
t1 <- totals(z1, obs=TRUE)
t2 <- totals(z2, obs=TRUE)
plot(t1, t2, names=c("with covariates", "without covariates"), main="Skylark", leg.pos="bottom")


rtrim documentation built on June 22, 2024, 10:39 a.m.