newModule

0th

Percentile

Create new module from template.

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)
"newModule"(name, path, open, unitTests)
"newModule"(name, open, unitTests)
"newModule"(name, path, unitTests)
"newModule"(name, unitTests)
"newModule"(name, path, open)
"newModule"(name, open)
"newModule"(name, path)
"newModule"(name)
newModuleCode(name, path, open)
"newModuleCode"(name, path, open)
newModuleDocumentation(name, path, open)
"newModuleDocumentation"(name, path, open)
"newModuleDocumentation"(name, open)
"newModuleDocumentation"(name, path)
"newModuleDocumentation"(name)
newModuleTests(name, path, open)
"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.
Details

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

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.

Note

On Windows there is currently a bug in RStudio that it doesn't know what editor to open with file.edit is called (which is what moduleName does). This will return an error:

Error in editor(file = file, title = title) : argument "name" is missing, with no default

You can just browse to the file and open it manually.

Aliases
  • newModule
  • newModule,character,character,logical,logical-method
  • newModule,character,character,logical,missing-method
  • newModule,character,character,missing,logical-method
  • newModule,character,character,missing,missing-method
  • newModule,character,missing,logical,logical-method
  • newModule,character,missing,logical,missing-method
  • newModule,character,missing,missing,logical-method
  • newModule,character,missing,missing,missing-method
  • newModuleCode
  • newModuleCode,character,character,logical-method
  • newModuleDocumentation
  • newModuleDocumentation,character,character,logical-method
  • newModuleDocumentation,character,character,missing-method
  • newModuleDocumentation,character,missing,logical-method
  • newModuleDocumentation,character,missing,missing-method
  • newModuleTests
  • newModuleTests,character,character,logical-method
Examples
## Not run: 
#   ## create a "myModule" module in the "modules" subdirectory.
#   newModule("myModule", "modules")
# ## End(Not run)
Documentation reproduced from package SpaDES, version 1.2.0, License: GPL-3

Community examples

Looks like there are no examples yet.