Search code examples
rmulticore

multicore::sapply?


Is there anything like sapply in the multicore library? Or do I have to unlist(mclapply(..)) in order to achieve this?

If it does not exist: what would the reasoning be?

Thanks in advance and sorry if this is a stupid question!


Solution

  • If you look at the code of sapply (and its helper function simplify2array) you will see that unlist(obj) is exactly what will be done in the case where obj is a list of items all of length==1. sapply is a lot more complex than just unlisting lists, however. What is still very unclear is what problem you are trying to solve.