This function saves the GAM model as RData (.rda) file. Optionally, it will save the model summary as a text (.txt) file, the mgcv::gam.check figures as a PNG (.png), and the mgcv::k.check output as a text (.txt) file.
Arguments
- gam_model
GAM model object to be saved as an RData file.
- output_file
RData output file name. Accepted a file extensions: .RData, .Rdata, .rdata, or .rda.
- model_summary
A logical indicating whether the model summary output should be saved as a text file. Default: TRUE
- model_check
A logical indicating whether the model check reports should be saved. Default: FALSE
Details
If model_summary
is TRUE, the output of summary(gam_model)
will
be captured and saved in a text file with the following naming convention
"<output_file>_Summary.txt".
If model_check
is TRUE, the outputs of mgcv::gam.check will be
captured and saved. mgcv::gam.check consists of two components:
GAM model diagnostic plots, implemented through gratia::appraise. The output will be saved with following naming convention: "<output_file>_GamCheck.png"
Smoothing basis dimension checks, implemented through mgcv::k.check. The output will be saved with the following naming convention: "<output_file>_GamCheck.txt"