Learn R Programming

SpaDES (version 1.0.1)

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, and a readme.txt file. The newModuleDocumentation will not generate the module file, but will create the other 4 files.

Usage

newModule(name, path, open)

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

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

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

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

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)

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.

Value

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

Details

All 5 (or 4, if using newModuleDocumentation) 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 DataLab