digits2number: Convert a vector of integers representing digits in an...

Description Usage Arguments Value References Examples

View source: R/violinPoint.R

Description

Takes a vector of integers representing digits in an arbitrary base e.g. binary or octal and converts it into an integer (or the integer divided by base^length(digits) for the number of digits if fractional is TRUE). Note that the first digit in the input is the least significant.

Usage

1
digits2number(digits, base = 2, fractional = FALSE)

Arguments

digits

a vector of integers representing digits in an arbitrary base

base

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

fractional

divide the output by the max for this number of digits and base. Note that this is base^length(digits) not base^length(digits)-1.

Value

an integer

References

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

Examples

1
2

vipor documentation built on May 1, 2019, 7:06 p.m.