moduleSource: Create a 'module' source

Description Usage Arguments Details Value See Also Examples

Description

Create a moduleSource object for use in a module's sources list.

Usage

1

Arguments

vessel

vessel object

order

numeric value specifying source position in sources

Details

The contents of a module's source script are provided by the vessel object. For inline code use a scriptVessel object. For a script file on the local filesystem use fileVessel.

vessel cannot be an inputVessel object, as these are not defined for moduleIO objects.

module sources are exectuted in the order determined by each source's ‘order’.

Running order is:

  1. negative numbers in ascending order

  2. zero

  3. no order specified

  4. positive numbers in ascending order

Value

named moduleSource list containing:

See Also

module, fileVessel, scriptVessel

Examples

1
2
3
4
5
6
7
8
9
## create moduleSource with source script inline
val1 <- c("x <- 1:10", "y <- rnorm(10, 0, 1)", "plot(x, y)")
src1 <- moduleSource(vessel = scriptVessel(value = val1),
                     order = -1)

## create a moduleSource with source script from file
modScript <- system.file("extdata", "simpleGraphScripts", "createGraph.R",
                         package = "conduit")
src2 <- moduleSource(vessel = fileVessel(ref = modScript))

anhinton/conduit documentation built on May 10, 2019, 11:48 a.m.