Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/r-utility-binary-integer.R
This function converts a binary vector to the corresponding integer number 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.
1 | binvec2int(v)
|
v |
an integer vector of 0's and 1's |
The input argument is considered a binary code word, ordered from the least significant bits to the most significant bits, and converted to the corresponding integer number according to the natural binary code.
An integer represented the input binary vector according to the natural binary code.
Pawel Cichosz <p.cichosz@elka.pw.edu.pl>
1 2 3 | binvec2int(c(1, 1, 0, 1))
binvec2int(c(1, 1, 0, 1, 0))
binvec2int(c(1, 1, 0, 1, 1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.