AddConstSingleRule-class: Class '"AddConstSingleRule"'

Description Objects from the Class Slots Extends Methods Author(s) See Also Examples

Description

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 from the Class

Objects can be created by calls of the form new("AddConstSingleRule", constantVal).

Slots

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

Extends

Class "SingleRule", directly.

Methods

calculateSpecific

signature(x = "AddConstSingleRule", y = "numeric", z = "ANY"): ...

Author(s)

Maria Rafalak <m.rafalak@practest.com.pl>

See Also

calculate, SingleRule, DoubleRule, createSR, createDR

Examples

 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)

ruleR documentation built on May 2, 2019, 5:49 p.m.