Returns built-in GAM formulas
loadModels(gamSelect = "gam4")
Returns a list with GAM formulas
By default, the function analysisOrganizeData will store the formulas for gam0-gam4 in the variable analySpec$gamModels as a list. The user can customize this list with the function loadModels (see example).
# run analysisOrganizeData function to create the list analySpec
dfr <- analysisOrganizeData (dataCensored, report=NA)
df <- dfr[["df"]]
analySpec <- dfr[["analySpec"]]
# current models in analySpec
analySpec$gamModels
#> [[1]]
#> [[1]]$option
#> [1] 0
#>
#> [[1]]$name
#> [1] "Linear Trend with Seasonality"
#>
#> [[1]]$model
#> [1] "~ cyear+ s(doy,bs='cc')"
#>
#> [[1]]$deriv
#> [1] TRUE
#>
#> [[1]]$gamK1
#> [1] NA NA
#>
#> [[1]]$gamK2
#> [1] NA NA
#>
#>
#> [[2]]
#> [[2]]$option
#> [1] 1
#>
#> [[2]]$name
#> [1] "Non-linear Trend with Seasonality"
#>
#> [[2]]$model
#> [1] "~ cyear + s(cyear, k=gamK1) + s(doy,bs='cc')"
#>
#> [[2]]$deriv
#> [1] TRUE
#>
#> [[2]]$gamK1
#> [1] 10.0000000 0.6666667
#>
#> [[2]]$gamK2
#> [1] NA NA
#>
#>
#> [[3]]
#> [[3]]$option
#> [1] 2
#>
#> [[3]]$name
#> [1] "Non-linear trend with Seas+Int"
#>
#> [[3]]$model
#> [1] "~ cyear + s(cyear, k=gamK1) + s(doy,bs='cc') + ti(cyear,doy,bs=c('tp','cc'))"
#>
#> [[3]]$deriv
#> [1] TRUE
#>
#> [[3]]$gamK1
#> [1] 10.0000000 0.6666667
#>
#> [[3]]$gamK2
#> [1] NA NA
#>
#>
#> [[4]]
#> [[4]]$option
#> [1] 3
#>
#> [[4]]$name
#> [1] "Non-linear trend with Seas+Int. & Intervention"
#>
#> [[4]]$model
#> [1] "~ intervention + cyear + s(cyear, k=gamK1) + s(doy,bs='cc') + ti(cyear,doy,bs=c('tp','cc'))"
#>
#> [[4]]$deriv
#> [1] TRUE
#>
#> [[4]]$gamK1
#> [1] 10.0000000 0.6666667
#>
#> [[4]]$gamK2
#> [1] NA NA
#>
#>
#> [[5]]
#> [[5]]$option
#> [1] 4
#>
#> [[5]]$name
#> [1] "Non-linear trend with Seas+Int. & Hydro Adj"
#>
#> [[5]]$model
#> [1] "~ cyear + s(cyear, k=gamK1) + s(doy,bs='cc') + ti(cyear,doy,bs=c('tp','cc')) + s(flw_sal,k=gamK2) + ti(flw_sal,doy,bs=c('tp','cc')) + ti(flw_sal, cyear,bs=c('tp' ,'tp')) + ti(flw_sal,doy,cyear, bs=c('tp','cc','tp'))"
#>
#> [[5]]$deriv
#> [1] TRUE
#>
#> [[5]]$gamK1
#> [1] 10.0000000 0.3333333
#>
#> [[5]]$gamK2
#> [1] 10.0000000 0.6666667
#>
#>
# set models in analySpec to gam0, gam1, and gam2 only
analySpec$gamModels <- loadModels(c('gam0','gam1','gam2'))