Learn R Programming

MiscMath (version 1.1)

IntDecToBin: Binary Expansion of Positive Integers

Description

Convert positive integers to their corresponding binary representation.

Usage

IntDecToBin(x, m = 31)

Value

a matrix containing the binary representations

Arguments

x

an integer vector

m

a numeric constant specifying the number of binary digits to use in the output

Examples

Run this code
x <- c(81, 57, 333) 
IntDecToBin(as.integer(x)) 

Run the code above in your browser using DataLab