style icon indicating copy to clipboard operation
style copied to clipboard

The tidyverse style guide for R code

Results 33 style issues
Sort by recently updated
recently updated
newest added

The style guide has: ```R map(x, f, extra_argument_a = 10, extra_argument_b = c(1, 43, 390, 210209) ) ``` But I think I now prefer keeping each argument on its own...

The guide currently has pretty broad rules about braces: https://style.tidyverse.org/syntax.html#indenting One edge case apparently precluded by the current rules is an empty expression: `{ }` or `{}`, for example empty...

The current recommendation is to use **package** on first usage, then just package I believe, or just package (Reference: https://github.com/tidyverse/style/issues/50). A recent trend is that people opt for {package}, .e.g....

Add specific section on magrittr feature best avoided.

Is there any advice we want to encode for long formulas? Currently the guide only discusses formulas w.r.t. operator spacing, and only in the context of one-sided formulas: https://style.tidyverse.org/syntax.html#infix-operators It's...

@richierocks, your SO post at https://stackoverflow.com/a/14155259/1082435 is explained well and perfect for this section. Consider replacing my explanation with a copy of your SO response.

Current advice in the guide prevents statements like the following: ``` units_power

Currently, the guide is silent on any recommendations re: vertical whitespace. Google's C++ guide has several recommendations: https://google.github.io/styleguide/cppguide.html#Vertical_Whitespace Most of it is relevant to R; is it worthwhile to call...

The [styleguide](https://style.tidyverse.org/documentation.html#cross-linking) suggests wrapping functions in **square brackets** to cross-link: ``` #' @seealso [fct_lump()] to automatically convert the rarest (or most common) #' levels to "other". ``` The next section...