Extract {bit} | R Documentation |
Operators acting on bit objects to extract or replace parts.
## S3 method for class 'bit': x[[i]] ## S3 method for class 'bit': x[[i]] <- value ## S3 method for class 'bit': x[i] ## S3 method for class 'bit': x[i] <- value
x |
a bit object |
i |
positive integer subscript |
value |
new logical or integer values |
Since this package was created for high performance purposes, only positive integer subscripts are allowed. The '[' and '[<-' methods don't check whether the subscripts are positive integers in the allowed range.
The extractors [[
and [
return a logical scalar or vector.
The replacment functions return a bit object.
Jens Oehlschlägel
x <- as.bit(c(FALSE, NA, TRUE)) x[] <- c(FALSE, NA, TRUE) x[1:2] x[[1]] x[] <- TRUE x[1:2] <- FALSE x[[1]] <- TRUE