Wrapper function to generate a single combined or separate SQL files for individual feature NOAA SWDI lagged aggregated time summaries mapped to individual MTBS fires by specified spatial degrees over a 180 day lag period for each fire

wrap_gen_query_ghcn_base_sfeat(
  sfeat_types,
  out_qry_dir,
  out_tbl_name_pfx,
  fire_base_tbl_name,
  ind_comb_qry = TRUE
)

Arguments

out_qry_dir

(character) : The directory to save the query. A full file path will be generated as part of the output

out_tbl_name_pfx

(character) : The default table name prefix to take. This will define prefix the name of the output table and also the output query file name. In this case a suitable default value is "ghcnd_observations"

fire_base_tbl_name

(character) : The table name for the GHCN-D observations table. In this case a suitable default value is "ghcnd_observations"

ind_comb_qry

(logical) : If TRUE then produces a single combined sql query for all features combined. If FALSE then produces a separate sql queries for individual GHCN-D feature

sfeat

(character) : The NOAA GHCN features to create a separate table for e.g c("PRCP", "SNOW", "SNWD", "TMAX", "TMIN", "TOBS", "TAVG"). In this wrapper the user should pass in a vector of all the features that are contained in the GHCN-D table. This will generate combined or separate queries to generate an individual table for each such GHCN-D feature

Value

(tibble) : A single or separate SQL files for single GHCN features joined to MTBS fire_ids by specified spatial and temporal parameters

Examples

if (FALSE) { library("tidyverse") wrap_gen_query_ghcn_base_sfeat(sfeat = c("PRCP", "SNOW", "SNWD", "TMAX", "TMIN", "TOBS", "TAVG"), out_qry_dir = ".", out_tbl_name_pfx = "ghcnd_observations", fire_base_tbl_name = "ghcnd_observations", ind_comb_qry = TRUE) }