bit (version 1.1-14)

as.bit: Coercing to bit

Description

Coercing to bit vector

Usage

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, …)

Arguments

x

an object of class bit, logical, integer, bitwhich or an integer from as.which or a boolean ff

length

the length of the new bit vector

further arguments

Value

is.bit returns FALSE or TRUE, as.bit returns a vector of class 'bit'

Details

Coercing to bit is quite fast because we use a double loop that fixes each word in a processor register

See Also

bit, as.logical

Examples

Run this code
# 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