plot_month_bar: Plot month bar

View source: R/plot_month_bar.R

plot_month_barR Documentation

Plot month bar

Description

Plots the output of parse_year_comp() as a bar chart of the difference of two periods

Usage

plot_month_bar(
  df,
  current = "2020",
  previous = "2015 - 2019",
  by_code = T,
  vline_pos = NULL,
  xlim = c(0, 12),
  na.rm = F,
  type = c("difference", "percent", "absolute")[1],
  combine_spc = F,
  highlight_range = xlim,
  show_err = T
)

Arguments

df

output of parse_year_comp()

current

name of group in column "y" to be subtracted from. default 2020

previous

name of group in column "y" to subtract from current, default "2015 - 2019"

by_code

logical, should the analysis be grouped by the code column

vline_pos

numeric vector to place vertical lines

na.rm

logical, should the data be filtered by filter(!is.na(value))

type

one of "difference", "percent" or "absolute".

  • difference - change is current-previous

  • percent - change is ((current-previous)/previous)*100

  • absolute - plot absolute values from current period only

combine_spc

logical, should species be used in facet wrapping

highlight_range

numerical vector length 2. range of values to highlight. bars that fall outside of this range have their alpha reduced. default equal to xlim

show_err

logical, show the standard error in the average on each bar. currently only avaliable when combine_spc = F

Author(s)

W. S. Drysdale and J. Davison


willdrysdale/AQVisR documentation built on July 24, 2022, 8:52 a.m.