3 ms·
>split/lapply/aggregate/ave I always feel bad when I resort to a for loop in R. Do you have any recommended ressources about mastering those specific manipulat
by curiousgal 8y ago
>split/lapply/aggregate/ave
I always feel bad when I resort to a for loop in R. Do you have any recommended ressources about mastering those specific manipulations?
- ekianjo 8y agoUnless you do something quitec complex dplyr is faster for such operations and consumes less RAM too.
- crispyambulance 8y agoReally, it's not always worth the trouble. Sometimes a loop is vastly more performant if you count the amount of time it takes to get the "idiomatic" way working and working in a way that allows easy troubleshooting.
- buchmayne 8y agohttps://github.com/jennybc/row-oriented-workflows https://github.com/jennybc/row-oriented-workflows getting comfortable with purrr has been enormously helpful in consolidating my code and avoiding unnecessary loops