tidyverse / style

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

Cross-linking: [ ] or backticks? #184

Open peterdesmet opened 2 years ago

peterdesmet commented 2 years ago

The styleguide 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 (https://style.tidyverse.org/documentation.html#r-code) suggests using backticks, including for functions.

  1. Why the different approach? Is it possible to use backticks or square brackets for all? I have the impression pkgdown treats them equally, but roxygen does not.
  2. Additionally, is there a recommendation to always use pkg:: when linking to a function of another package?