From 8ba1d5a1dba3f2805ef1e458f3ab3c8c1bc340cc Mon Sep 17 00:00:00 2001 From: dschlaep Date: Fri, 9 Sep 2016 08:38:28 +0200 Subject: [PATCH] Adding new settings 'agg_funs' and 'agg_years' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - this branch will be addressing issue #18 - setting option ‘agg_funs’ allows to choose which functions will be applied to aggregate output across years (and/or to output for each year) - setting option ‘agg_years’ contains sequences of years over which will be aggregated Former-commit-id: d3124f44e2783a7bef9981ee0330b8a921c16bd9 --- 2_SWSF_p1of5_Settings_v51.R | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/2_SWSF_p1of5_Settings_v51.R b/2_SWSF_p1of5_Settings_v51.R index 66d01df3..f7f03a11 100644 --- a/2_SWSF_p1of5_Settings_v51.R +++ b/2_SWSF_p1of5_Settings_v51.R @@ -319,6 +319,24 @@ Index_RunInformation <- NULL #indices of columns of 'SWRunInformation', e.g, c(3 #------Select aggregated output: time scale and variable groups #simulation_timescales is at least one of c("daily", "weekly", "monthly", "yearly") simulation_timescales <- c("daily", "monthly", "yearly") +# functions to aggregate output across years +# don't delete names, only set \code{TRUE}/\code{FALSE} +agg_funs <- list( + mean = TRUE, + SD = TRUE, + quantile = TRUE, + mad = TRUE, + yearly = TRUE +) +agg_fun_options <- list( + quantile = list(probs = c(0, 0.025, 0.5, 0.975, 1)) +) +# named list of time windows to aggregate over +agg_years <- c( + current1 = list(startyr:endyr), + current2 = list((endyr - 10):(endyr + 10)), + future = apply(future_yrs, 1, function(x) x["DSfut_startyr"]:x["DSfut_endyr"]) +) #turn aggregation for variable groups on (1) or off (0), don't delete any variable group labels output_aggregates <- c( #---Aggregation: SoilWat inputs