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

Description Usage Arguments Details See Also Examples

View source: R/trim_post.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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 April 21, 2020, 5:06 p.m.