tidyverse / style

The tidyverse style guide for R code
https://style.tidyverse.org
Other
292 stars 100 forks source link

Rules for shorthand lambda \() ? #204

Open MichaelChirico opened 1 year ago

MichaelChirico commented 1 year ago

I have been trying to incorporate \() into code more and wonder if the style guide would benefit from including some do's/don'ts about using it. For example, here are some rough rules I've been following:

hadley commented 1 month ago

Yeah, I think we could include some advice along the lines of you should only use it for simple, single-expression anonymous functions. We should also suggest that you use it instead of ~.