diff --git a/modules/Aggregation/Aggregation.R b/modules/Aggregation/Aggregation.R index e4cc6b978de82951127a63164b672156c27c0d92..15e4ec39a1e5984fafa9e90d785ea3384195b8ef 100644 --- a/modules/Aggregation/Aggregation.R +++ b/modules/Aggregation/Aggregation.R @@ -14,7 +14,7 @@ Aggregation <- function(recipe, data) { ncores <- recipe$Analysis$ncores # is it already checked? NULL or number na.rm <- ifelse(is.null(recipe$Analysis$remove_NAs), TRUE, recipe$Analysis$remove_NAs) # is it already checked? TRUE/FALSE - if (recipe$Analysis$Workflow$Time_aggregation$execute) { + if (isTRUE(recipe$Analysis$Workflow$Time_aggregation$execute)) { # original freq raw_freq <- tolower(recipe$Analysis$Variable$freq) custom <- recipe$Analysis$Workflow$Time_aggregation$user_def @@ -56,8 +56,14 @@ Aggregation <- function(recipe, data) { stop("Time_aggregation$user_def is not a list") } } + info(recipe$Run$logger, + "##### TIME AGGREGATION COMPLETE #####") + return(res) + } else { + warn(recipe$Run$logger, + paste("The Aggregation module has been called but parameter", + "Time_aggregation:execute is set to 'no' in the recipe.", + "The data is returned unchanged.")) + return(data) } - return(res) - info(recipe$Run$logger, - "##### TIME AGGREGATION COMPLETE #####") }