plot_week_bar: Plot week bar

View source: R/plot_week_bar.R

plot_week_barR Documentation

Plot week bar

Description

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

Usage

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

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

Author(s)

W. S. Drysdale


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