Skip to contents

Typically, use get_causal_ewr(). Bespoke function to clean the EWR table and LTWP table, extract environmental objectives, and pair them. Will need to change or at least extensively retest if those datasets change

Usage

clean_ewr_obj(
  ewrobjpath = "ewrcausal",
  gaugescale = TRUE,
  saveout = FALSE,
  outdir,
  savename
)

Arguments

ewrobjpath

path to the ewr-obj mapping. Default 'ewrtool' just uses the version in the tool.

gaugescale

logical, whether to return data at the gauge scale by remapping from LTWPShortName to gauge (TRUE), or to just leave at the LTWPShortName (e.g. sdl unit) scale as NSW now defines the relationships (FALSE)

saveout

one of FALSE, 'r', or 'csv', controls saving and type.

  • FALSE: (the default): Does not save anything

  • 'r': saves an rdata file, used primarily for building the data directory in a package

  • 'csv': saves a csv with the name outdir/savename_YearMonthDayHourMinute.csv

outdir

path to the directory to save into. not needed if saveout is FALSE

savename

character for the filename to save. the date and time gets appended to avoid overwriting

Value

A tibble with columns for LTWPShortName, ewr_code, ewr_code_timing, and env_obj (if gaugescale = FALSE), and including PlanningUnitID and gauge if gaugescale = TRUE)