Learn R Programming

birp (version 0.0.5)

plot.birp_data: Plot a birp_data Object

Description

This function plots observed counts per unit of effort over time, for each method-location combination in a birp_data object.

Usage

# S3 method for birp_data
plot(
  x,
  col = 1:length(x$locations),
  lwd = 1,
  lty = 1:length(x$method_names),
  pch = 1:length(x$CI_groups),
  xlab = "time",
  ylab = "counts per unit of effort",
  legend.x = "topright",
  legend.y = NULL,
  legend.bty = "o",
  xlim = range(as.numeric(x$times)),
  ylim = NA,
  ...
)

Value

No return value. Called for side effects.

Arguments

x

A birp_data object to be plotted.

col

A vector of colors, recycled to match the number of locations.

lwd

A vector of line widths, recycled to match the number of method-location combinations.

lty

A vector of line types, recycled to match the number of methods.

pch

A vector of plotting characters, recycled to match the number of control-intervention (CI) groups.

xlab

Label for the x-axis.

ylab

Label for the y-axis.

legend.x

The x-position for the legend. Use NA to omit the legend.

legend.y

The y-position for the legend.

legend.bty

Box type for the legend; either "o" (default) or "n".

xlim

Numeric vector specifying the x-axis limits.

ylim

Numeric vector specifying the y-axis limits. If NA, limits are computed automatically.

...

Additional graphical parameters passed to plot() or lines().

Examples

Run this code
data <- simulate_birp()
plot(data)

Run the code above in your browser using DataLab