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)

Arguments

mod_tbl

A tibble containing the columns ind and press..

ind_name

One or more character string naming the indicators of interest.

press_name

One or more character string naming the pressures of interest.

Value

The function returns a tibble including the id for the respective `ind` and/or `press`.

See also

Other IND~pressure modeling functions: ind_init(), model_gamm(), model_gam(), plot_diagnostics(), plot_model(), scoring(), select_model(), test_interaction()

Examples

# 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 x 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.146 " " 0.138 #> 2 2 TZA Swin gam none 48.1 2.74 0.0772 "." 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.0187 "*" 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 x 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 1.46e-1 " " #> 2 2 TZA Swin gam none 48.1 2.74 7.72e-2 "." #> 3 8 MS Tsum gam none -247. 1.00 8.83e-1 " " #> 4 9 MS Swin gam none -256. 1.74 1.87e-2 "*" #> 5 15 rCC Tsum gam none 92.7 1. 7.38e-5 "***" #> 6 16 rCC Swin gam none 110. 1. 7.98e-1 " " #> 7 22 Cops Tsum gam none 31.0 1.77 3.85e-1 " " #> 8 23 Cops Swin gam none 32.4 1. 5.17e-1 " " #> 9 29 Micro Tsum gam none 95.1 1. 6.21e-3 "**" #> 10 30 Micro Swin gam none 101. 2.75 3.25e-1 " " #> # … 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>