Use GAM analysis to compute residuals. Relies on mgcv::gam to perform general additive model.
createResiduals(
df,
dep,
residualModel = "doy_flw_sal",
analySpec = analySpec,
gamTable = FALSE,
gamPlot = FALSE,
flow.detrended = NA,
salinity.detrended = NA,
width = 10,
height = 3.5,
folder_r = "pltResiduals",
ProjRoot
)
data frame
variable
which gam formula is used to compute. Default = 'doy_flw_sal'
analytical specifications
gam table setting (set to FALSE to turn off table output) Default = FALSE
gam plot setting (set to FALSE to turn off plotting) Default = FALSE
data generated by detrended.flow. Default = NA
data generated by detrended.flow. Default = NA
width of png figure (inches). Default = 10
height of png figure (inches). Default = 3.5
folder to store residual plots
Root folder for project.
Returns df with appended column of data