This function creates a {tm} module class inside the current folder.

add_module(
  name,
  inherit = "TidyModule",
  path = getwd(),
  prefix = "tm",
  open = TRUE,
  dir_create = TRUE,
  export = FALSE
)

Arguments

name

The class name of the module.

inherit

Parent module class. Default is TidyModule.

path

Where to created the file. Default is getwd(). The function will add R to the path if the sub-folder exists.

prefix

filename prefix. Default is tm. Set to `NULL`` to disable.

open

Should the file be opened?

dir_create

Creates the directory if it doesn't exist, default is TRUE.

export

Logical. Should the module be exported? Default is FALSE.

Note

As a convention, this function will automatically capitalize the first character of the name argument.