length.bit {bit} | R Documentation |
Query the number of bits in a bit vector or change the number of bits in a bit vector.
## S3 method for class 'bit': length(x) ## S3 method for class 'bit': length(x) <- value
x |
a bit vector |
value |
the new number of bits |
Note that no explicit initialization is done.
As a consequence, when you first decrease and then increase length you might find that some 'new' bits are already TRUE
.
A bit vector with the new length
Jens Oehlschlägel
x <- bit(32) length(x) x[c(1, 32)] <- TRUE length(x) <- 16 x length(x) <- 32 x