Moving from “for to foreach”
I wanted to address this question in a broader scope, first of all, let’s look at “for” loop vs “foreach” option
The credit goes to Henry Scharf from Colorado State University.
“apply” and it derivative functions
R parallel — speed up the processes with mutli-core