as.integer64.character: Coerce to integer64

View source: R/integer64.R

as.integer64.characterR Documentation

Coerce to integer64

Description

Methods to coerce from other atomic types to integer64.

Usage

as.integer64(x, ...)

## S3 method for class ''NULL''
as.integer64(x, ...)

## S3 method for class 'integer64'
as.integer64(x, ..., keep.names = FALSE)

## S3 method for class 'double'
as.integer64(x, ..., keep.names = FALSE)

## S3 method for class 'complex'
as.integer64(x, ...)

## S3 method for class 'integer'
as.integer64(x, ...)

## S3 method for class 'raw'
as.integer64(x, ...)

## S3 method for class 'logical'
as.integer64(x, ...)

## S3 method for class 'character'
as.integer64(x, ...)

## S3 method for class 'factor'
as.integer64(x, ...)

## S3 method for class 'Date'
as.integer64(x, ...)

## S3 method for class 'POSIXct'
as.integer64(x, ...)

## S3 method for class 'POSIXlt'
as.integer64(x, ...)

## S3 method for class 'difftime'
as.integer64(x, units = "auto", ...)

## S3 method for class 'bitstring'
as.integer64(x, ...)

NA_integer64_

Arguments

x

an atomic vector

..., units

further arguments to the NextMethod()

keep.names

Logical, default FALSE. If TRUE, the input's names are retained.

Format

An object of class integer64 of length 1.

Details

as.integer64.character is realized using C function strtoll which does not support scientific notation. Instead of '1e6' use '1000000'. as.integer64.bitstring evaluates characters '0' and ' ' as zero-bit, all other one byte characters as one-bit, multi-byte characters are not allowed, strings shorter than 64 characters are treated as if they were left-padded with '0', strings longer than 64 bytes are mapped to NA_INTEGER64 and a warning is emitted.

Value

The other methods return atomic vectors of the expected types

See Also

as.character.integer64() integer64()

Examples

as.integer64(as.character(lim.integer64()))
as.integer64(
  structure(c("1111111111111111111111111111111111111111111111111111111111111110",
              "1111111111111111111111111111111111111111111111111111111111111111",
              "1000000000000000000000000000000000000000000000000000000000000000",
              "0000000000000000000000000000000000000000000000000000000000000000",
              "0000000000000000000000000000000000000000000000000000000000000001",
              "0000000000000000000000000000000000000000000000000000000000000010"
  ), class = "bitstring")
)
as.integer64(
 structure(c("............................................................... ",
             "................................................................",
             ".                                                               ",
             "",
             ".",
             "10"
  ), class = "bitstring")
)

bit64 documentation built on April 21, 2026, 9:06 a.m.