binary: convert decimal integers to binary codes

Description Usage Arguments Value Examples

View source: R/utils.R

Description

convert decimal integers to binary codes

Usage

1
binary(x, k = NULL)

Arguments

x

a vector of base 10 integers

k

length of binary codes (if no specified, this will be the length of the binary representation for the maximum in x). Default to NULL.

Value

A matrix of binary forms of x (by row)

Examples

1
2
3
decimals <- c(10,3,5)
binary(decimals)
binary(decimals,6)

zhenkewu/slamR documentation built on March 8, 2020, 1:31 a.m.