stash: Stash and Unstash Modules. List and Remove Stashes.

Description Usage Arguments Details Value Warning See Also Examples

View source: R/stash.R

Description

Stash and unstash all modules and internal state. List and remove stashes.

Usage

1
2
3
4
5
6
7

Arguments

comment

A string (character vector of length one).

id

A scalar (integer vector of length one).

all

A flag. Should all stashes be removed?

Details

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.

Value

A scalar (integer vector of length one) containing the stash ID.

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, list_modules, and reset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
reset()
remove_stash(all = TRUE)
define("foo", NULL, function() NULL)
stash("'foo' only")
list_stashes()
define("bar", NULL, function() NULL)
stash("'foo' and 'bar'")
list_stashes()
list_modules()
unstash(1L)
list_modules()

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