Just a question about a neat way to name the result matrix of a foreach loop. This works, but it's a bit verbose, I wonder if there is a simpler method:
r = foreach( i=seq(5), .combine=rbind, .final=function(res) { colnames(res) = c("First", "Second"); return(res) } ) %dopar% { c(i, i+1) }