plot_species_stratum_bar: Make single species stratum bar plots

View source: R/plot_stratum_species_bar.R

plot_species_stratum_barR Documentation

Make single species stratum bar plots

Description

Make condition time series bar plots with separate panels for each stratum.

Usage

plot_species_stratum_bar(
  x,
  region,
  var_x_name,
  var_y_name,
  var_y_se_name,
  y_title = "Length-weight residual (ln(g))",
  var_group_name = "stratum",
  fill_title = "Stratum",
  fill_palette = "BrBG",
  write_plot = TRUE
)

Arguments

x

Input data.frame

region

Region. AI, BS, or GOA. Character (1L).

var_x_name

Name of the x (time variable). Character (1L).

var_y_name

Name of the y variable in the data.frame. Character (1L).

var_y_se_name

Name of the standard error for the y variable. Character (1L).

y_title

Y-axis title. Character (1L).

var_group_name

Name of the variable to use for grouping (i.e., stratum). Character (1L).

fill_title

Name of the fill variable to use for plotting. Character (1L).

fill_palette

Character vector denoting which color palette to use. Must be a valid name for RColorBrewer::brewer.pal(name = fill_palette)

write_plot

Should plots be written to the /plot/ directory?

Value

A list of bar plots as ggplot objects

Examples

# EBS single species stratum bar plots

names(EBS_INDICATOR$STRATUM)

plot_species_stratum_bar(
x = EBS_INDICATOR$STRATUM,
region = "BS",
var_x_name = "year",
var_y_name = "stratum_resid_mean",
var_y_se_name = "stratum_resid_se",
y_title = "Length-weight residual (ln(g))",
var_group_name = "stratum",
fill_title = "Stratum",
fill_palette = "BrBG",
write_plot = FALSE)

afsc-gap-products/akfishcondition documentation built on June 11, 2025, 5:37 p.m.