Convert Number into Digits Using digits() Function of TeachingDemos Package in R
In this article you’ll learn how to convert numbers into single digits in R.
Example Data
my_numb <- 563588744 # Create example number my_numb # [1] 563588744 |
my_numb <- 563588744 # Create example number my_numb # [1] 563588744
Example: Split Number into Digits Using digits() Function of TeachingDemos Package
install.packages("TeachingDemos") library("TeachingDemos") |
install.packages("TeachingDemos") library("TeachingDemos")
my_digits <- digits(my_numb) # Apply digits function my_digits # [1] 5 6 3 5 8 8 7 4 4 |
my_digits <- digits(my_numb) # Apply digits function my_digits # [1] 5 6 3 5 8 8 7 4 4