powered by
Coercing to bit vector
as.bit(x, …) # S3 method for bit as.bit(x, …) # S3 method for logical as.bit(x, …) # S3 method for integer as.bit(x, …) # S3 method for bitwhich as.bit(x, …) # S3 method for which as.bit(x, length, …) # S3 method for ri as.bit(x, …)
an object of class bit, logical, integer, bitwhich or an integer from as.which or a boolean ff
bit
logical
integer
bitwhich
as.which
ff
the length of the new bit vector
further arguments
is.bit returns FALSE or TRUE, as.bit returns a vector of class 'bit'
is.bit
as.bit
Coercing to bit is quite fast because we use a double loop that fixes each word in a processor register
bit, as.logical
as.logical
# NOT RUN { x <- as.bit(c(FALSE, NA, TRUE)) as.bit(x) as.bit.which(c(1,3,4), 12) # }
Run the code above in your browser using DataLab