Skip to content

Commit e483840

Browse files
authored
Possible fix for twitter#77
after granulation from sec to min, assign 'min' so the switch instruction can now work properly
1 parent 1f5deaa commit e483840

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

R/ts_anom_detection.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ AnomalyDetectionTs <- function(x, max_anoms = 0.10, direction = 'pos',
164164
# Aggregate data to minutely if secondly
165165
if(gran == "sec"){
166166
x <- format_timestamp(aggregate(x[2], format(x[1], "%Y-%m-%d %H:%M:00"), eval(parse(text="sum"))))
167+
gran <- "min"
167168
}
168169

169170
period = switch(gran,

0 commit comments

Comments
 (0)