我在群集上运行 plyr 时遇到错误,而我在下面共享伪代码'm having a tough time debugging it. I'm . 我在 Xgetopt 中运行一个名为 getopt 的函数,它处理错误 . 它基本上对输入矩阵进行网格搜索优化,逐行 . 输入矩阵为11644x2 .

任何人都能告诉我这个错误来自何处或意味着什么?我不能做回溯,因为我无法在本地复制错误 .

> library(plyr)
> library(doMC)
> registerDoMC(32)
> 
> Xgetopt = function(input){
+   out = tryCatch(getopt(input), error=function(e) e, finally=NA)
+   if(inherits(out, "error")) {out=NA;     print("an error happened but it got handled.")}
+   return(out)
+   }
> 
> tocalc = expand.grid(ID = sort(unique(m$model$ID)), price = seq(from=0,to=100,by=2.5))
> tocalc$ID = as.character(tocalc$ID)
> out = dlply(.data=tocalc,c('ID','price'),.fun=Xgetopt,.parallel=TRUE)

[1] "an error happened but it got handled."
[1] "an error happened but it got handled."
[1] "an error happened but it got handled."

snip (only a few errors, mostly successes)

[1] "99 37.5"
Error in names(result) <- names(pieces) : 
  'names' attribute [11644] must be the same length as the vector [11187]
Calls: dlply -> llply
Execution halted