Reset the modulr internal state.

reset(all = FALSE, .verbose = TRUE)

Arguments

all

A flag. Should stashes be also dropped?

.verbose

A flag. For internal use only. Should be verbose?

Details

Reset the modulr internal state: definitions and configurations are dropped, verbosity is set to default (see set_verbosity), .Last.name is set to NULL (see .Last.name), and root directory is set to default (see root_config). After a reset, the special module modulr is automatically defined. If all is set to TRUE, stashes are also dropped (see stash).

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, define, list_modules, list_stashes, reset, root_config, set_verbosity, and stash.

Examples

reset()
#> [2018-12-02T17:14:10 CET] Resetting modulr state ... OK
define("foo", NULL, function() NULL)
#> [2018-12-02T17:14:10 CET] Defining 'foo' ... OK
root_config$set("./foobar") stash(comment = "foo stash")
#> [2018-12-02T17:14:10 CET] Stashing modulr state, stash #1 ... OK
set_verbosity(+Inf) reset()
#> [2018-12-02T17:14:10 CET] Entering reset() ... #> [2018-12-02T17:14:10 CET] Resetting modulr state ... OK
#> id timestamp comment #> 1 1 2018-12-02T17:14:10 CET foo stash
root_config$get_all()
#> [[1]] #> [1] "." "modules" #> [3] "module" "libs" #> [5] "lib" "/home/aclemen1/.modulr" #> [7] "/opt/R/3.2.5/lib64/R/etc/modulr.d" #>
.Last.name
#> NULL
reset(all = TRUE)
#> [2018-12-02T17:14:10 CET] Resetting modulr state ... OK
#> No stash found.