View source: R/model-downscale.R
derive_variables | R Documentation |
This function takes in a dataframe with model data, and a variable derivation CSV table with instructions detailing what the new variables will be named, how they will be calculated, and what their units will be.
derive_variables(
model_data_df,
mapping = get_variable_mapping("downscale/indicators.csv"),
drop_weighted_indicators = FALSE,
bind_derived_data = TRUE,
...
)
model_data_df |
data frame with pre-processed/corrected iTEM data in the appropriate format |
mapping |
dataframe specifying the variables to be created, along with instructions for creating them and the units of the new variable |
drop_weighted_indicators |
logical (default = FALSE) indicating whether to drop "weighted indicator" variables whose purpose is to allow computation of indicator variables, generally after some aggregations or re-assignments have been performed. Weighted indicators are generally excluded from final template reporting. |
bind_derived_data |
logical (default = TRUE) indicating whether to return a data frame with the original model data bound to the output of this function (TRUE), or to only return the variables calculated by this function (FALSE) |
This function derives new variables from existing variables in the data frame. Each new variable is derived from two and only two existing variables. The operations allowed are +, *, and /. Unit conversions are applied multiplicatively. If the operation is addition and there is a unit conversion provided, the conversion is applied to the second variable in the derivation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.