Examples for 'bit::Extract'


Extract or replace part of an boolean vector

Aliases: Extract [[.bit [[<-.bit [.bit [<-.bit [[.bitwhich [[<-.bitwhich [.bitwhich [<-.bitwhich

Keywords: classes logic

### ** Examples


  x <- as.bit(c(FALSE, NA, TRUE))
  x[] <- c(FALSE, NA, TRUE)
  x[1:2]
[1] FALSE FALSE
attr(,"vmode")
[1] "boolean"
  x[-3]
[1] FALSE FALSE
attr(,"vmode")
[1] "boolean"
  x[ri(1,2)]
[1] FALSE FALSE
attr(,"vmode")
[1] "boolean"
  x[as.bitwhich(c(TRUE,TRUE,FALSE))]
[1] FALSE FALSE
attr(,"vmode")
[1] "boolean"
  x[[1]]
[1] FALSE
attr(,"vmode")
[1] "boolean"
  x[] <- TRUE
  x[1:2] <- FALSE
  x[[1]] <- TRUE

[Package bit version 4.0.4 Index]