6.2 Optional conventions to organise functions

  • File names should be meaningful and convey which functions are defined within
  • Avoid having:
    • One file per function
    • All functions in the same file
  • A single .R file can have:
  • For small helper functions used in functions across different files are typically stored in R/utils.R by convention (e.g spotifyr/R/utils.R)

If its hard to predict in which file a function lives, it’s time to separate your functions into more files.