Reputation: 41
parSapply(cl = NULL, X, FUN, ..., simplify = TRUE,
USE.NAMES = TRUE)
By default it will run in random order of X. But I would like it scheduled in order of X. is that possible?
Upvotes: 1
Views: 76
Reputation: 440
Scheduling in order of X is not directly possible. But there are multiple ways to get around this. One of the very easy way is to use foreach with the option
.inorder=TRUE
Giving a base example. Please change it based on your need
t <- foreach(x=X,.inorder=TRUE) %dopar % { FUN }
Upvotes: 1