SpaDES (version 1.1.4)

newModule: Create new module from template.

Description

Autogenerate a skeleton for a new SpaDES module, a template for a documentation file, a citation file, a license file, a README.txt file, and a folder that contains unit tests information. The newModuleDocumentation will not generate the module file, but will create the other 4 files.

Usage

newModule(name, path, open, unitTests)

## S3 method for class 'character,character,logical,logical': newModule(name, path, open, unitTests)

## S3 method for class 'character,missing,logical,logical': newModule(name, open, unitTests)

## S3 method for class 'character,character,missing,logical': newModule(name, path, unitTests)

## S3 method for class 'character,missing,missing,logical': newModule(name, unitTests)

## S3 method for class 'character,character,logical,missing': newModule(name, path, open)

## S3 method for class 'character,missing,logical,missing': newModule(name, open)

## S3 method for class 'character,character,missing,missing': newModule(name, path)

## S3 method for class 'character,missing,missing,missing': newModule(name)

newModuleCode(name, path, open)

## S3 method for class 'character,character,logical': newModuleCode(name, path, open)

newModuleDocumentation(name, path, open)

## S3 method for class 'character,character,logical': newModuleDocumentation(name, path, open)

## S3 method for class 'character,missing,logical': newModuleDocumentation(name, open)

## S3 method for class 'character,character,missing': newModuleDocumentation(name, path)

## S3 method for class 'character,missing,missing': newModuleDocumentation(name)

newModuleTests(name, path, open)

## S3 method for class 'character,character,logical': newModuleTests(name, path, open)

Arguments

name
Character string. Your module's name.
path
Character string. Subdirectory in which to place the new module code file. The default is the current working directory.
open
Logical. Should the new module file be opened after creation? Default TRUE.
unitTests
Logical. Should the new module include unit test files? Default TRUE. Unit testing relies on the testthat package.

Value

  • Nothing is returned. The new module file is created at path/name.R, as well as ancillary files for documentation, citation, license, readme, and unit tests folder.

Details

All files will be created within a subfolder named name within the path.

Examples

Run this code
## create a "myModule" module in the "modules" subdirectory.
  newModule("myModule", "modules")

Run the code above in your browser using DataCamp Workspace