Sow: Asynchroneously return a value

Description Usage Arguments Details Author(s) See Also Examples

View source: R/RsowReap.R

Description

Asynchroneously return a value

Usage

1
Sow(..., sow_field = "default")

Arguments

...

value(s) to be returned

sow_field

tag to indicate a pool of values into which the value(s) are to be stored, defaults to 'default'

Details

This function stores values into the package environment, so that they can later be retrieved by the Reap function. A ReferenceClass is used to implement the storage logic. Nested calls of Reap/Sow are possible as a stack is internally maintained.

Author(s)

Stefan Böhringer, r-packages@s-boehringer.org

See Also

package-Reap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
packageDefinition = list(
	name = 'pkg-minimal',
	files = c(),
instFiles = list(),
	description = list(
		title = 'Minimal R-package created with `package`',
		# version to be documented in news section
		#version = '0.1-0',
		author = 'Stefan Böhringer <r-packages@s-boehringer.org>',
		description = 'This appears in the package-documentaion, the markdown of the git-repository and in the package details.',
		depends = c(),
		suggests = c(),
		license = 'LGPL',
		news = "0.1-0	Initial release"
	),
	git = list(
		readme = '## Installation\n```{r}\nlibrary(devtools);\ninstall_github("user/pkg-minimal")\n```\n',
		push = FALSE,
		pushOnNewVersion = FALSE
	)
);

sboehringer/sowreap documentation built on Feb. 16, 2021, 12:08 a.m.