Open Elsunais opened 5 years ago
Hello,
I have faced this error, and the solution is to input your data as a DataFrame object. here an example:
temp<- c(.0980, .0897, .0982, .0123, .0244, .0897)
anom<- ts(temp, frequency=1, start=c(2006, 1))
library(xts)
datx <- as.xts(anom)
df <- data.frame(date=index(datx), coredata(datx))
res = AnomalyDetectionTs(df)
res$plot
One final thing, you need more data to be able to use this function ( your example only has 6 data points)
Good luck !
I want to run an anomaly on time series. my codes are below:
but i kept having an error stating: "Error in AnomalyDetectionTs(anom, max_anoms = 0.2, direction = "both", : data must be a single data frame." Please i need help! Thank you