View source: R/number2binary.R
number2binary | R Documentation |
This is a wrapper function around intToBits
that returns a bit
code in fixed-length integer format. The code is based on an SO post by
Paul Hiemstra, see https://stackoverflow.com/questions/12088080/how-to-convert-number-into-binary-vector.
number2binary(number, no_bits, to_char = FALSE)
number |
An |
no_bits |
|
to_char |
|
A bit code in fixed-length integer
format or, if to_char
, a
single character
.
Florian Detsch
intToBits
.
number2binary(10)
number2binary(10, no_bits = 4)
number2binary(10, no_bits = 4, to_char = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.