From e48384016be4c21f60eeb0b2fad70eb9263f5aab Mon Sep 17 00:00:00 2001 From: Oskar Jarczyk Date: Tue, 29 Nov 2016 15:14:05 +0100 Subject: [PATCH] Possible fix for #77 after granulation from sec to min, assign 'min' so the switch instruction can now work properly --- R/ts_anom_detection.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/ts_anom_detection.R b/R/ts_anom_detection.R index a7e3abe..64dd747 100644 --- a/R/ts_anom_detection.R +++ b/R/ts_anom_detection.R @@ -164,6 +164,7 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos', # Aggregate data to minutely if secondly if(gran == "sec"){ x <- format_timestamp(aggregate(x[2], format(x[1], "%Y-%m-%d %H:%M:00"), eval(parse(text="sum")))) + gran <- "min" } period = switch(gran,