4 ms·
I almost gasped when I saw that their R code[1] does the bulk of its computations inside a while(...for(...for(...for(...if(...){...}else{...})))) block, instea
by cs702 12y ago
I almost gasped when I saw that their R code[1] does the bulk of its computations inside a while(...for(...for(...for(...if(...){...}else{...})))) block, instead of using functionals like apply and 'vectorized' operations like ifelse.
If this criticism seems harsh, compare the authors' R code to Hadley Wickham's advice at http://adv-r.had.co.nz/Profiling.html http://adv-r.had.co.nz/Profiling.html -- or just search Google for "speed-up loops in R".
--
[1] https://github.com/jesusfv/Comparison-Programming-Languages-Economics/blob/master/RBC_R.R https://github.com/jesusfv/Comparison-Programming-Languages-...
- collyw 12y agoMany of the bioinformaticains I know use R. Not knowing how to use it properly wouldn't surprise me in the slightest. I struggle to get some of them to indent their Perl code.