Learn R Programming

qrcode (version 0.2.2)

bits2int: Convert a bits object to an integer and vice versa

Description

Convert a bits object to an integer and vice versa

Usage

bits2int(x)

int2bits(i, n_bit = 16)

Arguments

x

the bits object

i

the integer

n_bit

the number of bits

Author

Thierry Onkelinx

See Also

Other bits: as.character.bits(), bits(), c.bits(), print.bits()

Examples

Run this code
z <- bits(c(FALSE, TRUE, TRUE, FALSE))
z
y <- bits2int(z)
y
int2bits(y)
int2bits(y, 4)

Run the code above in your browser using DataLab