General suggestions for making R code faster? [closed]
- by gsk3
Questions come up fairly frequently about how to make R code faster. This is an attempt to provide a general framework for thinking about the problem.
Questions of this nature seem to fall into one of a few categories:
I have a loop and it's running slowly. I've heard that vectorization
can speed things up. How do I vectorize it?
I've vectorized and it's still running slowly. What do I do next?
I'd like to speed up my code but it's running quickly enough already.
What are the principles and specifics which can be used to make R code run faster?