plot_boot_vec: Plot stochastic vectors

View source: R/plot_boot_vec.R

plot_boot_vecR Documentation

Plot stochastic vectors

Description

Plot median values and confidence intervals (shaded region) for stochastic (e.g. bootstrapped) vectors.

Usage

plot_boot_vec(
  data,
  CIpct = 95,
  runsToKeep = NULL,
  ref_x = NULL,
  ref_y = NULL,
  col_lines = rgb(0, 0, 0, 1),
  col_shade = NULL,
  add = FALSE,
  ...
)

Arguments

data

a numeric matrix or data frame that can be coerced to a numeric matrix where rows are runs and columns represent a numeric sequence (e.g. age, year). Note that the function would probably work for any numeric matrix, but it's intended for bootstrapped time- or age-series data.

CIpct

percentage to define the range of the confidence intervals to plot

runsToKeep

optional vector of integer values corresponding to the rows of data to include in the plot

ref_x, ref_y

x and y vectors for adding a reference line to the plot (e.g. base run values)

col_lines

color for lines depicting central tendency and confidence limits. Expects hex color

col_shade

color for shading confidence bands

add

logical. Should a new plot be drawn or should it be added to an existing plot?

...

other arguments to pass to matplot

Author(s)

Nikolai Klibansky

Examples

## Not run: 
bootData <- t(replicate(n=100,random_walk(mu=0.5)))
plot_boot_vec(bootData)

## End(Not run)

nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.