Extract: Extract or replace part of an bit vector

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Operators acting on bit objects to extract or replace parts.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'bit'
x[[i]]
## S3 replacement method for class 'bit'
x[[i]] <- value
## S3 method for class 'bit'
x[i]
## S3 replacement method for class 'bit'
x[i] <- value

Arguments

x

a bit object

i

positive integer subscript

value

new logical or integer values

Details

Since this package was created for high performance purposes, only positive integer subscripts make sense. Negative subscripts are converted to positive ones, beware the RAM consumption. Further subscript classes allowed for '[' and '[<-' are range indices ri and bitwhich. The '[' and '[<-' methods don't check whether the subscripts are positive integers in the allowed range.

Value

The extractors [[ and [ return a logical scalar or vector. The replacment functions return a bit object.

Author(s)

Jens Oehlschlägel

See Also

bit, Extract

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  x <- as.bit(c(FALSE, NA, TRUE))
  x[] <- c(FALSE, NA, TRUE)
  x[1:2]
  x[-3]
  x[ri(1,2)]
  x[as.bitwhich(c(TRUE,TRUE,FALSE))]
  x[[1]]
  x[] <- TRUE
  x[1:2] <- FALSE
  x[[1]] <- TRUE

OHDSI/bit documentation built on May 7, 2019, 8:30 p.m.