Stash and unstash all modules and internal state. List and remove stashes.
stash(comment = NA_character_) unstash(id = length(.modulr_env$injector$stash)) list_stashes() remove_stash(id, all)
comment | A string (character vector of length one). |
---|---|
id | A scalar (integer vector of length one). |
all | A flag. Should all stashes be removed? |
A scalar (integer vector of length one) containing the stash ID.
stash
allows to stash all modules and the internal state of modulr.
Each stash is pushed on a stack and can be commented for later reference.
unstash
pops a stash from the stack and restores the state
accordingly. list_stashes
lists the stack, showing ids, timestamps and
comments for each stash. remove_stash
removes one or all stashes from
the stack.
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.
define
, list_modules
, and
reset
.
#> [2018-12-02T17:14:11 CET] Removing all stashes ... OK#> [2018-12-02T17:14:11 CET] Defining 'foo' ... OKstash("'foo' only")#> [2018-12-02T17:14:11 CET] Stashing modulr state, stash #1 ... OKlist_stashes()#> id timestamp comment #> 1 1 2018-12-02T17:14:11 CET 'foo' only#> [2018-12-02T17:14:11 CET] Defining 'bar' ... OKstash("'foo' and 'bar'")#> [2018-12-02T17:14:11 CET] Stashing modulr state, stash #2 ... OKlist_stashes()#> id timestamp comment #> 1 1 2018-12-02T17:14:11 CET 'foo' only #> 2 2 2018-12-02T17:14:11 CET 'foo' and 'bar'#> name version storage along type weight calls dependencies uses size #> 1 bar <NA> in-memory <NA> <NA> <NA> 0 0 0 888 bytes #> 2 foo <NA> in-memory <NA> <NA> <NA> 0 0 0 888 bytes #> lines modified #> 1 2 2018-12-02T17:14:11 CET #> 2 2 2018-12-02T17:14:11 CETunstash(1L)#> [2018-12-02T17:14:11 CET] Unstashing modulr state, stash #1 ... OK#> name version storage along type weight calls dependencies uses size #> 1 foo <NA> in-memory <NA> <NA> <NA> 0 0 0 888 bytes #> lines modified #> 1 2 2018-12-02T17:14:11 CET