This function merges well water level data with streamflow data for further analysis. The streamflow data is filtered to include only non-negative values and specific date ranges. The function also limits the data to basins present in the `UniqueDivides` dataset.
Arguments
- x
A data frame containing streamflow data, which includes columns such as `var`, `value`, `date`, and `divide_id`.
- y
A data frame containing well water level data, such as `monthly_basin_average`. This dataset includes columns for `date`, `Divide`, and `mean_change_mm`.
- z
A data frame with unique divides (basins) to be used as a filter. Defaults to `UniqueDivides`.
Value
A data frame resulting from the inner join of the well water level data and streamflow data. The output includes the combined columns from both datasets, filtered by divide and date.
Details
The `JoinHydroData` function performs the following steps:
Filters the streamflow data (`x`) to retain only non-negative values of `var == "str"`.
Renames the `divide_id` column to `Divide` in both datasets.
Filters the streamflow data to include only basins present in the `UniqueDivides` data frame (`z`).
Restricts the data to dates on or after "2009-10-27".
Performs an inner join between the well water level data (`y`) and streamflow data (`x`) based on `date` and `Divide`.