etiennebacher / personal_website_distill

Personal website made with distill. Replacement of personal_website (made with blogdown)
https://etiennebacher.com
9 stars 1 forks source link

Etienne Bacher: Some notes about improving base R code #6

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Etienne Bacher: Some notes about improving base R code

https://www.etiennebacher.com/posts/2022-11-28-some-notes-about-improving-base-r-code/

yihui commented 1 year ago

Great tips! They are super helpful. Thanks for sharing!

My experience is that apply() is rarely a good choice if performance is desired, which is not surprising, though (apply() is a plain for-loop written in base R if you look at its source code).

BTW, it may not be what you expected, but I think my greatest discovery after reading this post is the poorman package, which you mentioned in the beginning. I don't know why I have never heard it before, but it looks very impressive to me.

etiennebacher commented 1 year ago

Thank you! Yeah apply() doesn't seem so fast, especially by rows, but at the same time I usually find it more readable.

Talking about poorman was indeed not the objective of the post 😅 but I'm happy you discovered it, I learn a lot about NSE by looking at the source code and it's very nicely built