Methods to coerce integer64 to other atomic types. 'as.bitstring' coerces
to a human-readable bit representation (strings of zeroes and ones).
The methods format()
, as.character()
, as.double()
,
as.logical()
, as.integer()
do what you would expect.
Usage
as.bitstring(x, ...)
# S3 method for class 'integer64'
as.double(x, keep.names = FALSE, ...)
# S3 method for class 'integer64'
as.integer(x, ...)
# S3 method for class 'integer64'
as.logical(x, ...)
# S3 method for class 'integer64'
as.character(x, ...)
# S3 method for class 'integer64'
as.bitstring(x, ...)
# S3 method for class 'bitstring'
print(x, ...)
# S3 method for class 'integer64'
as.list(x, ...)
Arguments
- x
an integer64 vector
- ...
further arguments to the
NextMethod()
- keep.names
FALSE, set to TRUE to keep a names vector
Value
as.bitstring
returns a string of class 'bitstring'.
The other methods return atomic vectors of the expected types
Examples
as.character(lim.integer64())
#> [1] "-9223372036854775807" "9223372036854775807"
as.bitstring(lim.integer64())
#> [1] "1000000000000000000000000000000000000000000000000000000000000001"
#> [2] "0111111111111111111111111111111111111111111111111111111111111111"
as.bitstring(as.integer64(c(
-2,-1,NA,0:2
)))
#> [1] "1111111111111111111111111111111111111111111111111111111111111110"
#> [2] "1111111111111111111111111111111111111111111111111111111111111111"
#> [3] "1000000000000000000000000000000000000000000000000000000000000000"
#> [4] "0000000000000000000000000000000000000000000000000000000000000000"
#> [5] "0000000000000000000000000000000000000000000000000000000000000001"
#> [6] "0000000000000000000000000000000000000000000000000000000000000010"