Error when using %dopar% instead of %do% in R (package doParallel)
I've come up with a strange error. Suppose I have 10 xts objects in a list called data. I now search for every three combinations using data_names <- names(data) combs <- combn(data_names, 3) My basic goal is to do a PCA on those 1080 triples. To speed things up I wanted do use the package doParallel . So here is the snippet shortened till the point where the error occurs: list <- foreach(i=1:ncol(combs)) %dopar% { tmp_triple <- combs[,i] p1<-data[tmp_triple[[1]]][[1]] p2<-data[tmp_triple[[2]]][[1]] p3<-data[tmp_triple[[3]]][[1]] data.merge <- merge(p1,p2,p3,all=FALSE) } Here, the merge