Skip to contents

Primary functions

prep_run_save_ewrs()
Set up, run, and (possibly) save EWR outputs
read_and_agg()
Read in data and aggregate along theme and spatial dimension
run_hydrobot_params()
Run HydroBOT through the aggregation step with a file of yaml parameters or passing in yaml as characters.
plot_outcomes()
Standardized plot functions for HydroBOT.

Aggregator

Multi-dimensional

read_and_agg()
Read in data and aggregate along theme and spatial dimension
multi_aggregate()
Iterative aggregation along theme and spatial dimensions

Dimension handling

general_aggregate()
Aggregate data along theme dimension
spatial_aggregate()
Aggregate along spatial dimension
temporal_aggregate()
Aggregate along the time dimension
theme_aggregate()
Aggregate along theme dimension

Built-in summary functions

ArithmeticMean()
Arithmetic mean aggregation
CompensatingFactor()
Compensating aggregation
GeometricMean()
Geometric mean aggregation
HarmonicMean()
Harmonic mean aggregation
LimitingFactor()
Limiting aggregation
Max()
Max aggregation with na.rm = TRUE by default except that all-NA vectors still return NA, not 0.
Median()
Median
Min()
Min aggregation with na.rm = TRUE by default except that all-NA vectors still return NA, not 0.
NumberOfValues()
Find number of items being aggregated
SpatialWeightedMean()
Weighted mean by area column
Sum()
Sum aggregation
Variance()
Variance aggregation
maxInterevent()
Get maximum interevent duration of a vector

Helpers

agg_names_to_cols()
Change aggregation history in col names to stepwise columns
identify_dimension()
Helper to identify the dimension of each step in aggsequence
is_notpoint()
Test whether an object is an sf other than a point
is_point()
Test whether an object is a spatial point sf
is_sf()
Test whether an object is an sf

Plotting and comparer

plot_outcomes()
Standardized plot functions for HydroBOT.
baseline_compare()
Compare values to a baseline
theme_hydrobot()
A standard ggplot theme for HydroBOT
create_base()
Creates a baseline column in several different ways. Helper for baseline_compare() but useful elsewhere too
difference()
Difference
relative()
Division (relative comparison)
oddsratio()
Odds ratio
grouped_colors()
Sets up colors within groups according to separate palettes
handle_palettes()
Makes the calls to scale_fill_* and scale_color_*, depending on whether color/fill and the palette type needed
make_pal()
Function to ensure colors match across plots
make_plot_table()
Make a table of the aggregations from a plot
plot_data_prep()
Some standard data preparation for plotting
plot_style_prep()
Some data preparation, checking, and type-finding based on the type of data and the way we want plots to look

Causal networks

causal_colors_general()
Set colors of nodes or edges
causal_ewr
Causal relationships for the EWRs
extract_vals_causal()
Extracts and arranges the aggregated values for use in causal network plots.
get_causal_ewr()
Extract causal network from EWR tool
make_causal_plot()
Builds a causal network plot
make_edges()
Create edges dataframe for causal network or theme aggregation
make_nodes()
Make a node df from the edges df
find_related_nodes()
Finds all nodes upstream and downstream of a set of focal nodes

Provided Data

basin
Murray-Darling Basin Polygon
basin_rivers
River lines in the basin
bom_basin_gauges
Gauge locations
causal_ewr
Causal relationships for the EWRs
cewo_valleys
Catchments within the Murray-Darling Basin
planning_units
Planning Units for long-term watering plans
resource_plan_areas
Resource plan areas
sdl_units
Sustainable diversion limits units

Module helpers

read_hydro()
Wrapper to read hydrographs into R
assess_ewr_achievement()
EWR logic test on incoming Annual EWRs
assess_ewr_interevents()
Some calculations needed for aggregation of interevent statistics
causal_ewr
Causal relationships for the EWRs
clean_ewr_obj()
Pair EWR indicators to environmental objectives
clean_ewr_requirements()
Cleans the EWR table to use for assessing target requirements by the outputs
clean_ewr_yearly()
Additional cleanup specific to yearly EWR outputs.
cleanewrs()
Clean up and standardise names and column types
get_causal_ewr()
Extract causal network from EWR tool
get_ewr_gauges()
get the gauges from the EWR tool
get_ewr_table()
Get the table of EWRs from the EWR tool
get_ewr_version()
Extract the package version. Does not get complications like git branches.
prep_ewr_output()
Make EWR results with achievement for ongoing use
prep_run_save_ewrs()
Set up, run, and (possibly) save EWR outputs
separate_ewr_codes()
Parser for EWR codes into the main code and the extra bits (called 'timing' for some reason)
get_iqqm_gauges()
Get the mapping of gauges to IQQM nodes for netcdf
get_module_output()
Get the outputs from modules and do minor cleaning
make_output_dir()
Set up the output directory structure based on parent directory and module at parent_dir/module_output/MODULE_NAME/subdir
read_and_geo()
Prepare ewr results from the EWR tool for use in aggregation

Sometimes helpful extras

check_missing_runs()
Similar to find_missing_runs, but excised from prep_run_save_ewrs to take the same arguments
find_expected_files()
Figure out the expected outputs
find_missing_runs()
Figure out missing expected outputs
find_scenario_paths()
get the paths to scenarios
safe_imap()
A wrapper for purrr::imap() and furrr::future_imap() that bypasses errors and potentially retries them