twitter / AnomalyDetection

Anomaly Detection with R
GNU General Public License v3.0
3.56k stars 779 forks source link

Update ts_anom_detection.R #7

Closed adamatw closed 9 years ago

adamatw commented 9 years ago

There's currently a bug for data with daily granulraity. If gran == day, AnomalyDetectionTs does a check:

if(only_last == 'hr')

However, only_last can also be null. If it is, this check generates an error which keeps AnomalyDetectionTs from finishing:

Error in if (only_last == "hr") { : argument is of length zero

This patch fixes the check for only_last parameter when gran == day.