create SQL tocalculate average duration of marine heatwaves by point in space, grouped by decade
avg_duration_by_decade_truncated_sql.Rd
craft the sql code to calculate averge MHW duration, using the data tables with models truncated by decade this will run on any table but you should restrict to those tables needed for analysis. Tables are required to have column lat, lon, mhw_onset (integer formatted dates like 20411231), mhw_dur this function does not check that the table has those columns, it only generates a string of SQL
Usage
avg_duration_by_decade_truncated_sql(
mhw_table,
start_year = 2040,
end_year = 2069,
ensemble_list_string = NA
)
Arguments
- mhw_table
character name of the table to analyze
- start_year
integer year to start, inclusive (dates will include this start year)
- end_year
integer year to end, inclusive (dates will include up to 12/31 of the end year)
- ensemble_list_string
character string that is a list of ensembles to include in format "006,007,008" ensembles have leaving zeros, are 3 digits and this must be a separated list with leading zeros