twitter / AnomalyDetection

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

Using AnomalyDetection in parallel or in any forked environment fails #60

Open jcpetkovich opened 8 years ago

jcpetkovich commented 8 years ago

Using AnomalyDetection in parallel across a data.frame currently fails with the following error:

Error in (function (display = \"\", width, height, pointsize, gamma, bg,  :  
    a forked child should not open a graphics device

Here is a trivial example to reproduce the problem:

library(parallel)
library(AnomalyDetection)
mclapply(as.data.frame(ts.union(BJsales, BJsales.lead)), AnomalyDetectionVec, period = 5)

Which produces the above errors.