clone: Clone a Module.

Description Usage Arguments Details Value Warning See Also Examples

View source: R/define.R

Description

Clone a module.

Usage

1
clone(name, from_name, deep = FALSE)

Arguments

name

A string (character vector of lenght one).

A module name can contain letters, figures and some special characters, namely _, -, and /. The latter is a namespace separator.

Names containing /mock/, /mocks/, /test/, /tests/, /example/, or /examples/ have a special meaning related to code testing and examples.

The name "modulr" corresponds to a special module and is therefore reserved.

from_name

Name of module to clone.

deep

A flag. Should the entire register entry be cloned?

Details

For versioning purposes, it is often useful to clone modules.

Value

A wrapper function around a make call for the defined module.

Warning

It is considered a very bad practice to define, touch, undefine, load, make, reset, or perform any other operation from within a module definition that may alterate the internal state of modulr.

See Also

define, make, reset, and root_config.

Examples

1
2
3
4
reset()
define("foo", NULL, function() "foo")
clone("bar", "foo")
make("bar")

openscienceunil/modulr documentation built on May 3, 2019, 5:49 p.m.