Skip to content

Commit

Permalink
Possible fix for twitter#77
Browse files Browse the repository at this point in the history
after granulation from sec to min, assign 'min' so the switch instruction can now work properly
  • Loading branch information
oskar-j authored Nov 29, 2016
1 parent 1f5deaa commit e483840
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/ts_anom_detection.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e483840

Please sign in to comment.