int2binvec: Convert an integer to a binary vector representation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/r-utility-binary-integer.R

Description

This function converts an integer to the corresponding binary vector using the natural binary code. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1
int2binvec(v, max = 255)

Arguments

v

an integer value

max

a maximum integer value to be represented

Details

The input value is converted to a binary code word, ordered from the least significant bits to the most significant bits, of length sufficient to represent the maximum value specified by max.

Value

An integer vector of 0's and 1's, representing v in natural binary code.

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

See Also

binvec2int

Examples

1
2
int2binvec(11, max=15)
int2binvec(11, max=63)

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.