Creating Helper Function

Creating a helper function make sense if it meet the following conditions:

  • Create it takes several lines of code.
  • The creating process doesn’t requires much time or memory.

It can be stored under any folder loaded by calling devtools::load_all():

  • Under the R/ folder as not exported function.
  • Under a R script starting with “helper” under the tests/testthat/folder.
new_useful_thing <- function() {
  # your fiddly code to create a useful_thing goes here