bin: Transform decimal into binary

Description Usage Arguments Details Value Author(s) Examples

View source: R/bin.R

Description

bin transforms a decimal number into a binary one in vectorial form.

Usage

1
bin(x)

Arguments

x

an integer

Details

bin takes as input an integer and transforms it into the corresponding binary number. The output is a vector whose elements are the coefficients of increasing powers of 2, i.e., the ith item is the coefficient for 2^(i-1). For instance, bin(4) returns (0,0,1).

Value

a vector of 0/1

Author(s)

Lucia Tamburino, Giangiacomo Bravo

Examples

1
for (i in 0:10) print(bin(i))

frt documentation built on May 2, 2019, 6:34 a.m.

Related to bin in frt...