add_module {SIAtools}R Documentation

Add a new SIA module to your package

Description

This is the workhorse of {SIAtools} package. The function checks if the package is properly configured for SIA modules and provides immediate fixes as needed. add_module() automatically puts a correct entry in SIA Modules Manifest of your package (which is created if not already present), and prepares .R file with the code template. Both files are automatically opened for you by default.

Usage

add_module(
  name = "new_module",
  title = NULL,
  category = NULL,
  open = TRUE,
  prefix = "sm_",
  proj = curr_proj()
)

Arguments

name

character, a name for the new SIA module.

title

character, new module's title. You can leave the default NULL and set manually in the manifest later on.

category

character, new module's category. The category dictates the tab within the {ShinyItemAnalysis} app to which the module should be appended. You can leave the default NULL and set manually in the manifest later on. Check the available categories using list_categories().

open

Whether to open the manifest and module's source for interactive editing. Defaults to TRUE.

prefix

character, a prefix to denote SIA module. It's highly recommended to stick with the default "sm_" (standing for SIA Module).

proj

character, a path to the project. Defaults to current project.

Value

No return value. Called for the side effects.

See Also

Other module management functions: get_modules(), preview_module(), remove_module()

Examples

## Not run: 
# add the module called "test" and edit the details later on in the YAML
add_module("test")

# specify the title and category at creation time
add_module("test", title = "Test module", category = "Validity")

## End(Not run)

[Package SIAtools version 0.1.1 Index]