touch: Touch a Module.

Description Usage Arguments Details Warning See Also Examples

View source: R/make.R

Description

Touch a module by marking it as outdated and by resetting its default configuration, if appropriate.

Usage

1

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.

Details

See make and module_options.

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

.Last.name, plot_dependencies, make, module_options, and reset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
reset()
define("foo", NULL, function() format(Sys.time(), "%H:%M:%OS6"))
make()
make()
touch()
make()

reset()
define("A", NULL, function() "(A)")
define("B", NULL, function() "(B)")
define("C", list(a = "A"), function(a) paste0("(", a, "C)"))
define("D", list(a = "A", b = "B"), function(a, b) paste0("(", a, b, "D)"))
define("E", list(d = "D"), function(d) paste0("(", d, "E)"))
define("F", list(c = "C", d = "D", e = "E"),
  function(c, d, e) paste0("(", c, d, e, "F)"))
make()
touch("B")
make("F")
plot_dependencies()

reset()
define("foo", list(bar = "bar"), function(bar) bar)
define("bar#1.0.0", NULL, function() "bar v1.0.0")
define("bar#1.0.1", NULL, function() "bar v1.0.1")
make("foo")
maps_config$set(foo = list("bar" = "bar#1.0.0"))
make("foo")
touch("foo")
make("foo")

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