Learn R Programming

HapEstXXR (version 0.1-8)

dec2bin: Decimal To Binary Conversion

Description

dec2bin function converts a decimal number to a binary number.

Usage

dec2bin(vec, npos = NA)

Arguments

vec
a numeric vector of positive values.
npos
an optional number of length of the generating binary number.

Value

dec2bin returns a matrix.

Details

This is a function to converting from decimal to binary number.

Examples

Run this code
binary <- dec2bin(zz <- sample(0:100, 10))
print(zz)
print(binary)

Run the code above in your browser using DataLab