Articles by Ulrik Stervbo

Computation time of loops — for, *apply, map

June 19, 2019 | Ulrik Stervbo

It is usually said, that for– and while-loops should be avoided in R. I was curious about just how the different alternatives compare in terms of speed. The first loop is perhaps the worst I can think of – the return vector is initialized without type and length so that the ...
[Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)