Functions to coerce to bitwhich
# S3 method for class '`NULL`'
as.bitwhich(x, ...)
# S3 method for class 'bitwhich'
as.bitwhich(x, ...)
# S3 method for class 'which'
as.bitwhich(x, maxindex = attr(x, "maxindex"), ...)
# S3 method for class 'ri'
as.bitwhich(x, ...)
# S3 method for class 'integer'
as.bitwhich(x, poslength = NULL, ...)
# S3 method for class 'double'
as.bitwhich(x, poslength = NULL, ...)
# S3 method for class 'logical'
as.bitwhich(x, poslength = NULL, ...)
# S3 method for class 'bit'
as.bitwhich(x, range = NULL, poslength = NULL, ...)
as.bitwhich(x = NULL, ...)An object of class 'bitwhich', 'integer', 'logical' or 'bit' or an integer vector as resulting from 'which'
further arguments
the length of the new bitwhich vector
the number of selected elements
a ri() or an integer vector of length == 2 giving a
range restriction for chunked processing
a value of class bitwhich()
as.bitwhich(`NULL`): method to coerce to bitwhich() (zero length) from
NULL
as.bitwhich(bitwhich): method to coerce to bitwhich() from bitwhich()
as.bitwhich(which): method to coerce to bitwhich() from which()
as.bitwhich(ri): method to coerce to bitwhich() from ri()
as.bitwhich(integer): method to coerce to bitwhich() from
integer() (0 and NA become FALSE, everthing
else becomes TRUE)
as.bitwhich(double): method to coerce to bitwhich() from
double() (0 and NA become FALSE, everthing
else becomes TRUE)
as.bitwhich(logical): method to coerce to bitwhich() from logical()
as.bitwhich(bit): method to coerce to bitwhich() from bit()
CoercionToStandard, as.booltype(), as.bit(),
as.bitwhich() , as.which(), as.ri(), ff::as.hi(), ff::as.ff()
as.bitwhich(c(0L, 1L, 2L, -2L, NA))
#> bitwhich: 3/ 5 occupying only 2 int32 in -1 representation
#> 1 2 3 4 5
#> FALSE TRUE TRUE TRUE FALSE
as.bitwhich(c(0, 1, 2, -2, NA))
#> bitwhich: 3/ 5 occupying only 2 int32 in -1 representation
#> 1 2 3 4 5
#> FALSE TRUE TRUE TRUE FALSE
as.bitwhich(c(NA, NA, NA))
#> bitwhich: 0/ 3 occupying only 1 int32 in FALSE representation
#> 1 2 3
#> FALSE FALSE FALSE
as.bitwhich(c(FALSE, FALSE, FALSE))
#> bitwhich: 0/ 3 occupying only 1 int32 in FALSE representation
#> 1 2 3
#> FALSE FALSE FALSE
as.bitwhich(c(FALSE, FALSE, TRUE))
#> bitwhich: 1/ 3 occupying only 1 int32 in 1 representation
#> 1 2 3
#> FALSE FALSE TRUE
as.bitwhich(c(FALSE, TRUE, TRUE))
#> bitwhich: 2/ 3 occupying only 1 int32 in -1 representation
#> 1 2 3
#> FALSE TRUE TRUE
as.bitwhich(c(TRUE, TRUE, TRUE))
#> bitwhich: 3/ 3 occupying only 1 int32 in TRUE representation
#> 1 2 3
#> TRUE TRUE TRUE