Description Objects from the Class Slots Extends Methods See Also Examples
A class for rules calculating a sum of digits of a single element of numeric sequence.
It inherits from class SingleRule
.
Objects can be created by calls of the form new("DigSumSingleRule", ...)
.
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
Class "SingleRule"
, directly.
signature(x = "DigSumSingleRule", y = "numeric", z = "ANY")
: ...
calculate
,
createSR
,
createDR
,
SingleRule
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.