From 08eb0cff88c93d8ecb5d15a81387586b4249bfd8 Mon Sep 17 00:00:00 2001 From: Gaurav Godhwani Date: Tue, 17 Apr 2018 03:21:54 +0530 Subject: [PATCH] Aggregate data to minutely if secondly --- 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,