twitter / AnomalyDetection

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

ad_ts does not work with data.table #113

Open fedemolina opened 4 years ago

fedemolina commented 4 years ago

I'm using a data set with different time series, I'm store it as data.table So in every iteration I filter by some condition:

DT[var1 == x, c("date", "var2")]

Error in rbindlist(l, use.names, fill, idcol) : Class attribute on column 1 of item 2 does not match with column 1 of item 1.

This happen because date column is store as numeric(0), ie:

all_anoms <- data.frame(timestamp = numeric(0), count = numeric(0)) meanwhile column date is required to be POSIXct/POSIXlt