powered by
Estimate percent change trends from GAM results for selected time periods
anlz_perchg(mod, baseyr, testyr)
A data frame of summary results for change between the years.
input model object as returned by anlz_gam
anlz_gam
numeric vector of starting years
numeric vector of ending years
Working components of this function were taken from the gamDiff function in the baytrends package.
library(dplyr) # data to model tomod <- rawdat %>% filter(station %in% 34) %>% filter(param %in% 'chl') mod <- anlz_gam(tomod, trans = 'log10') anlz_perchg(mod, baseyr = 1990, testyr = 2016)
Run the code above in your browser using DataLab