plot.trim.index: Plot time-indices from trim output.

View source: R/trim_index.R

plot.trim.indexR Documentation

Plot time-indices from trim output.

Description

Uncertainty ranges exressed as standard errors are always plotted. Confidence intervals are plotted when they are present in the trim.index object, i.e. when requested for in the call to index.

Usage

## S3 method for class 'trim.index'
plot(
  x,
  ...,
  names = NULL,
  covar = "auto",
  xlab = "auto",
  ylab = "Index",
  pct = FALSE,
  band = "se"
)

Arguments

x

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

...

additional trim.index objects, or parameters that will be passed on to plot.

names

optional character vector with names for the various series.

covar

[character] the name of a covariate to include in the plot. If set to "auto" (the default), the first (or only) covariate is used. If set to "none" plotting of covariates is suppressed and only the overall index is shown.

xlab

a title for the x-axis. The default value is "auto" will be changed to "Time Point" if the time ID's start at 1, and to "Year" otherwise.

ylab

a title for the y-axis. The default value is "Index".

pct

Switch to show the index values as percent instead as fraction (i.e., for the base year it will be 100 instead of 1)

band

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

See Also

Other analyses: coef.trim(), confint.trim(), gof(), index(), now_what(), overall(), overdispersion(), plot.trim.overall(), plot.trim.smooth(), results(), serial_correlation(), summary.trim(), totals(), trendlines(), trim(), vcov.trim(), wald()

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

Examples


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

# Example with user-modified title, and different y-axis scaling
plot(idx, main="Skylark", pct=TRUE)

# Using covariates:
z <- trim(count ~ site + year + habitat, data=skylark2, model=3)
idx <- index(z, covars=TRUE)
plot(idx)

# Suppressing the plotting of covariate indices:
plot(idx, covar="none")


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