ms_run_egret | R Documentation |
ms_run_egret prepares data for the EGRET package and runs the Weighted Regression on Time, Discharge, and Season (WRTDS) model.
ms_run_egret(
stream_chemistry,
discharge,
prep_data = TRUE,
run_egret = TRUE,
kalman = FALSE,
quiet = FALSE,
site_data = NULL
)
stream_chemistry |
|
discharge |
|
prep_data |
logical. Should data be thinned/altered to follow EGRET recommendations? See details for more information. |
run_egret |
logical. If FALSE, the EGRET model will not be run and an EGRET eList will be returned. This argument is intended for those who want to change default parameters in the EGRET model but need data in the eList format. |
quiet |
logical. Should warnings be printed to console? |
site_data |
tibble. Default NULL, if you are using a non-MacroSheds site you must supply a tibble with the columns: site_code, ws_area_ha, latitude, longitude. If using a MacroSheds site you can leave this argument NULL and the MacroSheds site_data table will be retrieved. |
Kalman |
logical. Should EGRET run the Kalman filter on WRTDS results? See
|
WRTDS is a model to predict stream chemistry at a daily time step based on the season, discharge, and time since last grab sample. This model is useful for calculating flux when sampling is sparse (greater than a weekly sampling frequency). For more information on the WRTDS and EGRET package see https://github.com/USGS-R/EGRET.
prep_data
will remove NAs from the dataset, set all 0 values in stream
chemistry dataset to the minimum value in the dataset (this is required because EGRET will
fail if there are 0 values in a dataset), remove years with fewer than 6 chemistry samples,
and remove datetimes when there is chemistry but no discharge data reported.
returns a list
in the EGRET format with model results.
Spencer Rhea
Mike Vlah, vlahm13@gmail.com
Wes Slaughter
ms_load_product()
, ms_conversions()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.