View source: R/ms_undo_scale_flux_by_area.R
ms_undo_scale_flux_by_area | R Documentation |
MacroSheds chemical flux is scaled to watershed area by default (kg/ha/d).
This function converts chemical flux to kg/d. If You generated precipitation chemical
flux yourself with ms_calc_watershed_precip()
, it is in kd/d and this function is not needed.
ms_undo_scale_flux_by_area(d)
d |
|
MacroSheds reports all chemical flux on a per area basis (kg/ha/d) to
facilitate comparison of watersheds of different sizes. Sometimes un-scaled
fluxes are of interest. This function will convert the units of a native
MacroSheds chemical flux dataset from kg/ha/d to kg/d. To download
MacroSheds data, see ms_download_core_data()
.
MacroSheds format (only site_code and val columns required as inputs to this function):
header value | column_definition |
date | Date in YYYY-mm-dd |
site_code | A unique identifier for each MacroSheds site, identical to primary source site code where possible. See ms_load_sites() . |
grab_sample | Boolean integer indicating whether the observation was obtained via grab sample or installed sensor. 1 = TRUE (grab sample), 0 = FALSE (installed sensor). |
var | Variable code. See ms_load_variables() . |
val | Data value. See ms_load_variables() for units. |
ms_status | Boolean integer. 0 = clean value. 1 = questionable value. See "Technical Validation" section of the MacroSheds data paper for details. |
ms_interp | Boolean integer. 0 = measured or imputed by primary source. 1 = interpolated by MacroSheds. See "Temporal Imputation and Aggregation" section of the MacroSheds data paper for details. |
val_err | The combined standard uncertainty associated with the corresponding data point, if estimable. See "Detection Limits and Propagation of Uncertainty" section of the MacroSheds data paper for details. |
returns a data.frame
in MacroSheds format with stream or precipitation chemical flux in kg/d.
Spencer Rhea
Mike Vlah, vlahm13@gmail.com
Wes Slaughter
ms_scale_flux_by_area()
ms_root <- 'data/macrosheds'
ms_download_core_data(macrosheds_root = ms_root,
domains = 'hbef')
d <- ms_load_product(macrosheds_root = ms_root,
prodname = 'stream_flux_inst_scaled',
domains = 'hbef',
filter_vars = 'NO3_N')
d <- ms_undo_scale_flux_by_area(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.