twitter / AnomalyDetection

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

Error when running AnomalyDetection with Rscript #76

Open joaoborges opened 8 years ago

joaoborges commented 8 years ago

Hello,

when running AnomalyDetection inside R (gui or interactive terminal) I have no errors, but when running with Rscript I've got the following error:

Error in .setupMethodsTables(fdef, initialize = TRUE) :
  trying to get slot "group" from an object of a basic class ("NULL") with no slots
Calls: AnomalyDetectionTs ... getMethodsForDispatch -> .getMethodsTable -> .setupMethodsTables
Execution halted

Thus, to fix this I had to include library(methods) in my script.

Although it is running ok with this, it is generating a Rplots.pdf file after each iteration, which may indicate the cause for the above error.

FrankPortman commented 8 years ago

May or may not be related:

https://github.com/twitter/AnomalyDetection/issues/73 https://github.com/twitter/AnomalyDetection/pull/61

smmurphy commented 7 years ago

I'm having the same issue using Rscripts. Everything works fine with library(methods) in the script, or alternatively using R CMD BATCH.

These appear to be related: https://github.com/tudo-r/BatchJobs/issues/28 https://github.com/tudo-r/BatchJobs/issues/27

jbrant commented 6 years ago

It's because the graphics device is being opened even when "plot=FALSE" is set. Reference the "plot.new()" call at the end of ts_anom_detection.R and vec_anom_detection.R. This appears to be fixed in tag v1.0.1, but it's not in the master.

Try reinstalling with the tag explicitly specified: devtools::install_github("twitter/AnomalyDetection", ref="v1.0.1")