number2digits: Convert an integer to an arbitrary base

Description Usage Arguments Value References Examples

View source: R/violinPoint.R

Description

Takes an integer and converts it into an arbitrary base e.g. binary or octal. Note that the first digit in the output is the least significant.

Usage

1

Arguments

n

the integer to be converted

base

the base for the numeral system (e.g. 2 for binary or 8 for octal)

Value

a vector of length ceiling(log(n+1,base)) respresenting each digit for that numeral system

References

https://en.wikipedia.org/wiki/Radix

Examples

1
2

vipor documentation built on May 29, 2017, 9:38 a.m.