as.logical.bit {bit} | R Documentation |
Coercing from bit to logical or integer
## S3 method for class 'bit': as.logical(x, ...) ## S3 method for class 'bit': as.integer(x, ...) which(x, ...) ## Default S3 method: which(x, arr.ind = FALSE, ...) ## S3 method for class 'bit': which(x, negative = NA, ...)
x |
an object of class bit |
arr.ind |
see which |
negative |
TRUE returns negative subscripts, FALSE returns positive subscripts, NA returns whatever requires less memory |
... |
further arguments (formally required) |
as.logical.bit
and as.integer.bit
return a vector of FALSE, TRUE
resp. 0,1
.
which.bit
returns a vector of subscripts (which
has been made generic).
Coercion from bit is quite fast because we use a double loop that fixes each word in a processor register.
a vector of class 'logical' or 'integer'
Jens Oehlschlägel
bit
, as.bit
, as.logical
, as.integer
, which
x <- as.bit(c(FALSE, NA, TRUE, rep(TRUE, 9))) as.logical(x) as.integer(x) which.bit(x) which.bit(x, negative=TRUE) which.bit(x, negative=FALSE)