library(randtoolbox) int2bit(5) int2bit(6) bit2int(c(1,0,1)) bit2int(c(0,1,1)) bit2unitreal(c(1,0,1))