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()
#> [2017-06-21T21:58:30 UTC] Resetting modulr state ... OK
define("foo", NULL, function() NULL)
#> [2017-06-21T21:58:30 UTC] Defining 'foo' ... OK
root_config$set("./foobar") stash(comment = "foo stash")
#> [2017-06-21T21:58:30 UTC] Stashing modulr state, stash #1 ... OK
set_verbosity(+Inf) reset()
#> [2017-06-21T21:58:30 UTC] Entering reset() ... #> [2017-06-21T21:58:30 UTC] Resetting modulr state ... OK
#> id timestamp comment #> 1 1 2017-06-21T21:58:30 UTC foo stash
root_config$get_all()
#> [[1]] #> [1] "../inst/modules" #>
.Last.name
#> NULL
reset(all = TRUE)
#> Error in reset(all = TRUE): unused argument (all = TRUE)
#> id timestamp comment #> 1 1 2017-06-21T21:58:30 UTC foo stash