Skip to contents

Identify typical water management schedule across multiple water years of data

Usage

generalize_wetland_mode(df, fullmode = NULL, clean = FALSE)

Arguments

df

Input tibble from estimate_wetland_mode()

fullmode

One of M or H; only necessary if clean = TRUE; see Details

clean

Logical; determines whether to correct for repeat values of F and D

Value

Input tibble with only one entry for each month for each unit, the most frequent value for "mode", and an additional field weight giving the proportion of years observed containing that management mode in that month.

Details

For each unit, identifies and returns the most frequent management mode in each month and calculates weight as the proportion of water years in which that mode was detected. Low values for weight reflect months with more annual variability in the monthly management schedules.

Note that ties are not returned, and in the case of ties, the function favors returning modes in the following order: F, D, I, M, H, N (see estimate_wetland_mode() for details). It is therefore possible for the function to return multiple months with values for F and D. Setting clean=TRUE will reclassify duplicate values of F and D to fullmode, but will also remove weight estimates since they may no longer be valid.

Examples

df = format_watertracker(sampledat) |> estimate_flood_extent() |>
  estimate_flood_delta() |> estimate_wetland_mode()
generalize_wetland_mode(df)
#> # A tibble: 204 × 10
#>    WETLAND     unit  CLASS AREA_HA AREA_AC AREA_AC_WETTED month_name month mode 
#>    <chr>       <chr> <chr>   <dbl>   <dbl>          <dbl> <fct>      <dbl> <fct>
#>  1 SampleWetl… Samp… mana…    37.1    91.6           61.2 Oct           10 F    
#>  2 SampleWetl… Samp… mana…    37.1    91.6           61.2 Nov           11 M    
#>  3 SampleWetl… Samp… mana…    37.1    91.6           61.2 Dec           12 M    
#>  4 SampleWetl… Samp… mana…    37.1    91.6           61.2 Jan            1 M    
#>  5 SampleWetl… Samp… mana…    37.1    91.6           61.2 Feb            2 M    
#>  6 SampleWetl… Samp… mana…    37.1    91.6           61.2 Mar            3 D    
#>  7 SampleWetl… Samp… mana…    37.1    91.6           61.2 Apr            4 D    
#>  8 SampleWetl… Samp… mana…    37.1    91.6           61.2 May            5 N    
#>  9 SampleWetl… Samp… mana…    37.1    91.6           61.2 Jun            6 N    
#> 10 SampleWetl… Samp… mana…    37.1    91.6           61.2 Jul            7 N    
#> # ℹ 194 more rows
#> # ℹ 1 more variable: weight <dbl>