AnomalyDetection icon indicating copy to clipboard operation
AnomalyDetection copied to clipboard

Error: "data must be a single data frame, list, or vector that holds numeric values" When data is a dataframe in correct format...

Open nullbuddy1243 opened this issue 10 years ago • 3 comments

Hey everyone.

I am trying to run my dataframe through the AnomalyDetectorVec(). My dataframe is a small one, for now, and I believe it is in the correct format.

Here is the dataframe:

> str(es_out)

'data.frame':   500 obs. of  2 variables:
 $ timestamp_list: POSIXct, format: "2015-07-23 04:10:56" "2015-07-23 04:10:51" "2015-07-23 04:11:11" ...
 $ in_bytes_list : int  3893 3893 2335 2319 3893 125 71 71 52 657 ...

When I try to run it through AnomalyDetectorVec(), I get an error:

> AnomalyDetectionVec(es_out, period=500, plot=TRUE, verbose=TRUE)

Error in AnomalyDetectionVec(es_out, period = 500, plot = TRUE, verbose = TRUE) : 
  data must be a single data frame, list, or vector that holds numeric values.

What is going wrong here? I cannot seem to figure it out...

Here is a dput() of my dataset and my dataframe conversion funciton in a pastebin, for cleanliness.

Dataset dput(): http://pastebin.com/WkY7pvwt Dataframe conversion function: http://pastebin.com/EsAcVNbV

Any help would be greatly appreciated. As far as I can tell, my dataframe is in the correct format, but I guess it actually isn't.

Thanks!

nullbuddy1243 avatar Jul 23 '15 05:07 nullbuddy1243

@deusofnull You need to have a single column data frame, list, or vector as the input argument x in order to use AnomalyDetectorVec(). Instead, you can use AnomalyDetectionTs(). Please take a look at the help files for detailed usage of these functions.

terrytangyuan avatar Aug 02 '15 22:08 terrytangyuan

Thanks @terrytangyuan , I am new to R and didnt realize the [,2] syntax for column selection...

nullbuddy1243 avatar Aug 03 '15 02:08 nullbuddy1243

Could anyone close this?

terrytangyuan avatar Feb 13 '16 19:02 terrytangyuan