Learn R Programming

wqtrends (version 1.5.1)

show_perchg: Plot percent change trends from GAM results for selected time periods

Description

Plot percent change trends from GAM results for selected time periods

Usage

show_perchg(
  mod,
  baseyr,
  testyr,
  ylab,
  base_size = 11,
  xlim = NULL,
  ylim = NULL
)

Value

A ggplot object

Arguments

mod

input model object as returned by anlz_gam

baseyr

numeric vector of starting years

testyr

numeric vector of ending years

ylab

chr string for y-axis label

base_size

numeric indicating base font size, passed to theme_bw

xlim

optional numeric vector of length two for x-axis limits

ylim

optional numeric vector of length two for y-axis limits

Examples

Run this code
library(dplyr)

# data to model
tomod <- rawdat %>%
  filter(station %in% 34) %>%
  filter(param %in% 'chl')
  
mod <- anlz_gam(tomod, trans = 'log10')

show_perchg(mod, baseyr = 1995, testyr = 2016, ylab = 'Chlorophyll-a (ug/L)')

Run the code above in your browser using DataLab