bit (version 1.1-14)

as.which: Coercion to (positive) integer positions

Description

Coercing to something like the result of which which

Usage

as.which(x, …)
# S3 method for default
as.which(x, …)
# S3 method for ri
as.which(x, …)
# S3 method for bit
as.which(x, range = NULL, …)
# S3 method for bitwhich
as.which(x, …)

Arguments

x

an object of classes bit, bitwhich, ri or something on which which works

range

a ri or an integer vector of length==2 giving a range restriction for chunked processing

further arguments (passed to which for the default method, ignored otherwise)

Value

a vector of class 'logical' or 'integer'

Details

as.which.bit returns a vector of subscripts with class 'which'

See Also

as.bit, as.logical, as.integer, as.which, as.bitwhich, as.ff, as.hi

Examples

Run this code
# NOT RUN {
  r <- ri(5, 20, 100)
  x <- as.which(r)
  x

  stopifnot(identical(x, as.which(as.logical(r))))
  stopifnot(identical(x, as.which(as.bitwhich(r))))
  stopifnot(identical(x, as.which(as.bit(r))))
# }

Run the code above in your browser using DataCamp Workspace