Description Objects from the Class Slots Extends Methods Author(s) See Also Examples
A class for rules which add a specified constant value to the previous element of a numeric sequence.
Objects of this class inherit from SingleRule.
Objects can be created by calls of the form new("AddConstSingleRule", constantVal).
constantVal:Object of class numeric - a constant that will be added to the previous element of numeric sequence
previousRule:Object of class SingleRule - a rule that will be executed before AddConstSingleRule (this is an argument used to combine different rules together). If no previous rule is specified, an IdenSingleRule will be used.
.S3Class:Object of class character - S3 methods apply to this object
Class "SingleRule", directly.
signature(x = "AddConstSingleRule", y = "numeric", z = "ANY"): ...
Maria Rafalak <m.rafalak@practest.com.pl>
calculate,
SingleRule,
DoubleRule,
createSR,
createDR
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##[1] A rule that adds 4 to the previous element of numeric sequence
m <- new("AddConstSingleRule", constantVal=4) #or
m <- createSR(a1=2, cv1=4, n=0)
print(m)
##[2] combining rules
p <- new("DigSumSingleRule") # a rule that calculates digitsum of a given element
m <- new("AddConstSingleRule",constantVal=5, previousRule=p)
# or in one step:
# m <- createSR(a1=2, cv1=5, n=1, 5, 0)
print(m)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.