2

I am trying to estimate multiple nonparametric models using snowfall. So far I had no problems, but now I run into a problem that I feel unable to resolve.

In the MWE below we simply estimate only one model on one node. In my application the structure is the same. When I try to plot the model results or use another function from the np package (like npsigtest()), I get the error

Error in is.data.frame(data) : ..1 used in an incorrect context, no ... to look in

Has anyone an idea what causes the problem? I am open to another approach concerning parallel estimation of several models.

MRE:

library(np)
library(snowfall)

df     <- data.frame(Y = runif(100, 0, 10), X = rnorm(100))
models <- list(as.formula(Y ~ X))

sfInit(parallel = T, cpus = length(models))
sfExport("models")
sfExport("df")
sfLibrary(snowfall)
sfLibrary(np)
lcls <- sfLapply(models, fun = npregbw, data = df, regtype = "lc")
sfStop()

plot(lcls[[1]])
Martin Schmelzer
  • 23,283
  • 6
  • 73
  • 98
  • FWIW, this is not related to `snowfall`. The same error happens with `plot(lapply(models, FUN = npregbw, data = df, regtype = "lc")[[1]])`. – Ralf Stubner Jun 21 '18 at 18:50
  • Thought so. It is weird because I did not update any package or other related software and from one day to the next it throws that error. – Martin Schmelzer Jun 21 '18 at 19:06
  • Are you sure that worked at one point? I get the same result not only locally (R 3.5.0, np 0.60.8) but also with the Docker images `rocker/r-ver:3.3.3` (`np` version 0.60.2) and `rocker/r-ver:3.4.4` (`np` version 0.60.6). – Ralf Stubner Jun 21 '18 at 21:15
  • I will check again if I made an slight change. – Martin Schmelzer Jun 22 '18 at 08:54

0 Answers0