DecToBin | R Documentation |
Convert a given decimal constant in the interval (0, 1) to the corresponding binary representation.
DecToBin(x, m = 32, format = "character")
x |
a numeric vector of values in the interval (0, 1) |
m |
a numeric constant specifying the number of binary digits to use in the output |
format |
a character string constant specifying the form of the output |
Default format is as a character string. Alternatives are plain
which prints
results to the device, and vector
which output a binary vector.
a vector containing the binary representation
x <- c(.81, .57, .333)
DecToBin(x) # character output
DecToBin(x, format="vector") # binary vector output
DecToBin(x, format="plain")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.