DigSumSingleRule-class: Class 'DigSumSingleRule'

Description Objects from the Class Slots Extends Methods See Also Examples

Description

A class for rules calculating a sum of digits of a single element of numeric sequence. It inherits from class SingleRule.

Objects from the Class

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

Slots

previousRule:

Object of class "SingleRule" rule to be executed on an element of numeric sequence before DigSumSingleRule, by default is NULL

.

.S3Class:

Object of class "character" - S3 methods apply to this object

Extends

Class "SingleRule", directly.

Methods

calculateSpecific

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

See Also

calculate, createSR, createDR, SingleRule

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##[1] simple single rule
b<-new("DigSumSingleRule")
print(b)

b<-createSR(a1=4,n=0) #See 'createSR' for details
print(b)

##[2] combining single rules
b<-new("DigSumSingleRule",previousRule=new("DigSumSingleRule"))#or b<-createSR(a1=5,cv1=0,n=1,5,0)
print(b)

#name: DigSumSingleRule
#name: DigSumSingleRule

calculate(b,785) #2 because 7+8+5=20; 2+0=2

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