4 ms·
Not really. All packages are bytecode compiled, so unless you doing something stupid, for loops are much faster than they used to be in R.
by jfolson 12y ago
Not really. All packages are bytecode compiled, so unless you doing something stupid, for loops are much faster than they used to be in R.
- RockyMcNuts 12y agogood to know...was doing something in 2013 that couldn't be vectorized (lots of portfolio simulation calcs where each element in dataframe depended on previous elements, ie portfolio value + market return - spending based on moving average of portfolio value) and it was pretty horrible, trying to use Rcpp and whatnot to speed it up!