find_id
is a helper function for the user to extract the ID for a
specific indicator(IND), pressure or IND~pressure combination. The `id` in
the returned tibble can then be used for filtering tibbles when using the
other IND~pressure modeling functions.
find_id(mod_tbl, ind_name = NULL, press_name = NULL)
mod_tbl | A tibble containing the columns |
---|---|
ind_name | One or more character string naming the indicators of interest. |
press_name | One or more character string naming the pressures of interest. |
The function returns a tibble including the id for the respective `ind` and/or `press`.
Other IND~pressure modeling functions:
ind_init()
,
model_gamm()
,
model_gam()
,
plot_diagnostics()
,
plot_model()
,
scoring()
,
select_model()
,
test_interaction()
# Using the Baltic Sea demo data: # Look for specific INDs in combination with every pressure ind_name <- c("TZA","MS") find_id(model_gam_ex, ind_name)$id#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14# Look for specific IND~pressure combinations press_name <- c("Tsum", "Swin") find_id(model_gam_ex, ind_name, press_name)#> # A tibble: 4 × 17 #> id ind press model_type corrstruc aic edf p_val signif_code r_sq #> <int> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> <dbl> #> 1 1 TZA Tsum gam none 49.8 1.92 0.145 " " 0.138 #> 2 2 TZA Swin gam none 48.1 2.74 0.0778 "." 0.211 #> 3 8 MS Tsum gam none -247. 1.00 0.883 " " -0.0391 #> 4 9 MS Swin gam none -256. 1.74 0.0191 "*" 0.257 #> # … with 7 more variables: expl_dev <dbl>, nrmse <dbl>, ks_test <dbl>, #> # tac <lgl>, pres_outlier <list>, excl_outlier <list>, model <list># Look for specific pressures in combination with every IND find_id(model_gam_ex, press_name = press_name)#> # A tibble: 24 × 17 #> id ind press model_type corrstruc aic edf p_val signif_code #> <int> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> #> 1 1 TZA Tsum gam none 49.8 1.92 0.145 " " #> 2 2 TZA Swin gam none 48.1 2.74 0.0778 "." #> 3 8 MS Tsum gam none -247. 1.00 0.883 " " #> 4 9 MS Swin gam none -256. 1.74 0.0191 "*" #> 5 15 rCC Tsum gam none 92.7 1.00 0.0000906 "***" #> 6 16 rCC Swin gam none 110. 1.00 0.798 " " #> 7 22 Cops Tsum gam none 31.0 1.77 0.386 " " #> 8 23 Cops Swin gam none 32.4 1.00 0.517 " " #> 9 29 Micro Tsum gam none 95.1 1.00 0.00632 "**" #> 10 30 Micro Swin gam none 101. 2.75 0.326 " " #> # … with 14 more rows, and 8 more variables: r_sq <dbl>, expl_dev <dbl>, #> # nrmse <dbl>, ks_test <dbl>, tac <lgl>, pres_outlier <list>, #> # excl_outlier <list>, model <list>