Skip to content

as.integer64.integer64() is inconsistent to as.integer.integer() #188

@hcirellu

Description

@hcirellu

When calling as.integer() of an integer with diverse attributes, the result is a plain integer vector.

i32 <- structure(as.integer(c("1", "2", "3", "4")), names="a", dim=c(2, 2), dimnames=list(c("r1", "r2"), c("c1", "c2")), other=1:2)
as.integer(i32)
# [1] 1 2 3 4

When calling as.integer64() the object is just returned.

i64 <- structure(as.integer64(c("1", "2", "3", "4")), names="a", dim=c(2, 2), dimnames=list(c("r1", "r2"), c("c1", "c2")), other=1:2)
as.integer64(i64)
# integer64
#    c1 c2
# r1 1  3 
# r2 2  4 
# attr(,"names")
# [1] a    <NA> <NA> <NA>
# attr(,"other")
# [1] 1 2 

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚠️ Breaking changeIssues whose solution requires a back-incompatible change to the public API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions