Skip to content

parRapply and parCapply return a list in corner cases

1 message · Simone Giannerini

#
For the record: I filed a bug report here

https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17807

and this is a more polished minimal example

   library(parallel)
   nslaves <- 2
   cl      <- makeCluster(nslaves)
  X       <- matrix(c(1,0,1),1,3)
    res <- parCapply(cl,X,FUN=function(x){
        y <- x[1]
        if(y==1){
            out <- y
        }else{
            out <- double(0)
        }
        return(out)
    })
[[1]]
[1] 1

[[2]]
numeric(0)

[[3]]
[1] 1

Simone
On Mon, May 18, 2020 at 5:23 PM Simone Giannerini <sgiannerini at gmail.com> wrote: