digits: a function to separate digits from a number

Description Usage Arguments Value References See Also Examples

Description

That is a function to separate digits from a number. This function is used in DigSumSingleRule, which calculates the sum of digits.

Usage

1
digits(x)

Arguments

x

numeric value of which digits are separated

Value

A vector which contains the digits if the number (in base 10).

References

https://stat.ethz.ch/pipermail/r-help/2011-March/270786.html

See Also

DigSumSingleRule

Examples

1
2
3
m<-digits(46)
m[1]#4
m[2]#6

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