Learn R Programming

INDperform (version 0.2.2)

get_sum_output: Extract specific outputs from the GAM(M) summary

Description

get_sum_output is a helper function for model_trend, model_gam, and model_gamm and extracts from a list of summary.gam objects specific values defined in `varname`.

Usage

get_sum_output(sum_list, varname, cell = NULL)

Arguments

sum_list

A list of summary objects created with summary.gam.

varname

A character naming the element to extract from the `sum_list`.

cell

If more than one value is stored under `varname` you need to specify which one you want to pull with `cell`.

Value

The function returns a vector with the length of `sum_list` containing the extracted values.

See Also

model_trend, model_gam, model_gamm

Examples

Run this code
# NOT RUN {
# Using some models of the Baltic Sea demo data:
sum_list <- purrr::map(model_gam_ex$model, ~mgcv::summary.gam(.) )
get_sum_output(sum_list, varname = "edf")

# Get p-val with cell argument:
get_sum_output(sum_list, "s.table", cell = 4)
# }

Run the code above in your browser using DataLab