Learn R Programming

adana (version 1.1.0)

decode4int: Convert binary vectors to integer vectors

Description

The function decode4int converts each element in a given binary vector to a integer number.

Usage

decode4int(x, M, ...)

Arguments

x

A vector containing binary numbers

M

A vector containing the number of bits of each binary in the x.

Further arguments passed to or from other methods.

Value

A vector of integer for input binary vector

Details

This function converts each element in the binary vector passed with the x argument to an integer. The M argument refers to the number of bits of each binary in the x vector.

See Also

encode4int

Examples

Run this code
# NOT RUN {
binmat = c(0,0,1,1,1,0,0,1,0,0,1,0)
M = c(4,4,4)
intmat = decode4int(binmat, M=M)
intmat
# }

Run the code above in your browser using DataLab