trendsPlot: trendsPlot

trendsPlotR Documentation

trendsPlot

Description

Makes a plot of trends in bird populations

Usage

trendsPlot(
  object,
  trendtype,
  estimate = "psi",
  est_symbol = "line",
  est_color = "dark green",
  est_shape = 19,
  obs_color = "black",
  obs_shape = 17,
  error_symbol = "ribbon",
  plot_title = NA,
  legend = T,
  plot = TRUE
)

Arguments

object

An unmarked fit object with an yearly trend such as those produced by unmarkedBirds, a data.frame produced by summarizeTrend, or a list of such objects.

trendtype

Either "occu" or "pcount". Indicates if this is from an occupancy model or an n-mixture model. Only required if object is a data.frame.

estimate

Either "psi", the default, or "z". Inidicates the type of esimate you wish to display.

est_symbol

Either "point" or "line". Indicates how you wish to display the estimate.

est_color

The color of the estimate.

est_shape

If est_symbol is "point" this will control the shape of the points. Default is a filled circle.

obs_color

The color of the observed data.

obs_shape

This controls the shape of the observed points. Default is a filled triangle.

error_symbol

This controls how the 95% CIs are displayed. Either "bar" for error bars or "ribbon" for a lightly shaded region.

plot_title

Optional, A title for the plot.

legend

If TRUE will include a legend in the plot.

plot

Logical. Return plot TRUE (default) or data.frame FALSE.

Details

This function produces plot of trends based on the output of summarizeTrend. If the object is the output of unmarkedBirds then the function will automatically detect if the trend is based on an occupancy or n-mixture model. If the object is a data.frame this has to be specified using the trendtype agrument.

The plot will display both the naive values and the model estimates. The type of estimate is controlled by the esitmate argument. If this is "psi", then the model estimates will be the model coefficients back transformed to occupancy or abundance. This is the estimated value for a site given its site. The other option,"z", takes into account not only site covariates but also the visit covaraites and actual detection history for each site. The estiamte will also display upper and lower limits for a 95% CI.

Several arguments control the graphical display. The naive values are always points, but their color and shape can be selected by the user. Estiamated values can also be displayed and customized as points, or can be a line instead. Error in the estimates can either be shown as yearly error bars or as a "ribbon" - a shaded area around the estimate. The color and shape arguments accept standard ggplot2 options.


NCRN/NCRNbirds documentation built on Aug. 28, 2023, 12:12 p.m.