iter <- 1000
myvec <- c()
while(is.null(myvec) || nrow(myvec) <= iter){
x = rnorm(10, mean = 0, sd = 1)
if(sum(x) > 2.5){
myvec <- rbind(myvec, x)
}
}
I want to parallelize the above while loop, where I keep iterating until I have a total of iter = 1000 entries in myvec. I checked out this post here, but I don't think the answer there is applicable to my example.