Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

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

Open
jcpetkovich opened this issue Sep 29, 2015 · 0 comments · May be fixed by #61
Open

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

jcpetkovich opened this issue Sep 29, 2015 · 0 comments · May be fixed by #61

Comments

@jcpetkovich
Copy link

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.

jcpetkovich added a commit to jcpetkovich/AnomalyDetection that referenced this issue Oct 6, 2015
plot.new() is generally unfriendly to call unless it will actually be
used for drawing, and certainly not if we ask for no plots to be
created.

plot.new triggers the completion of the previous plotting action, and as
such can't be used in combination with any multithreading or forked R
processes.

plot.new also does not return a "plot" object, it always returns `NULL`,
so although it appears to be used here as a way of returning a "null
plot", all that really happens is that AnomalyDetection* returns
`list(..., plot = NULL)`.

This commit resolves twitter#60
@jcpetkovich jcpetkovich linked a pull request Oct 6, 2015 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant