Description Constructors Accessors Author(s) See Also Examples
A Stage object represents a role to be played by protocols in a
pipeline. In other words, a stage is an abstract step that transforms
one data type into another. The transformation may be implemented in a
number of ways, each corresponding to a protocol. Users normally do
not have to interact with this object. Developers can define new types
of stages with setStage.
Stage(role):
Creates a stage object given the role name.
role(object): Gets the name of the role represented by
this stage.
displayName(object): Gets the name for displaying
this stage in a user interface.
inType(object): Gets the class of data that protocols
of this stage accept as input.
outType(object): Gets the class of data that protocols
of this stage yield as output.
defaultMethod(object): Gets the name of the default
method associated with the role of this stage. If not explicitly
set, this becomes the first protocol registered for the stage.
defaultMethod(object) <- value: Sets the name of the
default method associated with the role of this stage.
methodNames(object, where =
topenv(parent.frame())): Gets the names of the methods
for this stage, looking in where for the protocol classes.
Michael Lawrence
setStage for defining new types of stages
1 2 3 4 5 6 7 8 9 10 | setStage("average", "Average Numbers", intype = "numeric")
setProtocol("mean", fun = mean, parent = "average")
setProtocol("median", fun = median, parent = "average")
stage <- Stage("average")
stage
defaultMethod(stage)
defaultMethod(stage) <- "median"
defaultMethod(stage)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.