a function to separate digits from a number

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.