DigitSum: Calculate Digit Sum

View source: R/DescTools.r

DigitSumR Documentation

Calculate Digit Sum

Description

Calculate digit sum of a number x.

Usage

DigitSum(x)

Arguments

x

an integer number

Value

the digit sum

Author(s)

Andri Signorell <andri@signorell.net> based on code by Julius benchmarked by Uwe

References

URL: https://stackoverflow.com/questions/18675285/digit-sum-function-in-r

See Also

IsPrime

Examples

DigitSum(c(124, 45, 268))
# [1]  7  9 16

DescTools documentation built on Sept. 26, 2024, 1:07 a.m.