Description Usage Arguments Details Value Note Author(s) See Also Examples
Coercing to bit vector
1 2 3 4 5 6 7 8 9 10 11 12 13 | as.bit(x, ...)
## S3 method for class 'bit'
as.bit(x, ...)
## S3 method for class 'logical'
as.bit(x, ...)
## S3 method for class 'integer'
as.bit(x, ...)
## S3 method for class 'bitwhich'
as.bit(x, ...)
## S3 method for class 'which'
as.bit(x, length, ...)
## S3 method for class 'ri'
as.bit(x, ...)
|
x |
an object of class |
length |
the length of the new bit vector |
... |
further arguments |
Coercing to bit is quite fast because we use a double loop that fixes each word in a processor register
is.bit
returns FALSE or TRUE, as.bit
returns a vector of class 'bit'
Zero is coerced to FALSE, all other numbers including NA are coerced to TRUE. This differs from the NA-to-FALSE coercion in package ff and may change in the future.
Jens Oehlschlägel
1 2 3 |
Attaching package bit
package:bit (c) 2008-2012 Jens Oehlschlaegel (GPL-2)
creators: bit bitwhich
coercion: as.logical as.integer as.bit as.bitwhich which
operator: ! & | xor != ==
querying: print length any all min max range sum summary
bit access: length<- [ [<- [[ [[<-
for more help type ?bit
Attaching package: 'bit'
The following object is masked from 'package:base':
xor
bit length=3 occupying only 1 integers
1 2 3
FALSE TRUE TRUE
bit length=12 occupying only 1 integers
1 2 3 4 5 6 7 8 9 10 11 12
TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.