Skip to content

arrange(-x) not working as I expect with integer64 class #4366

@moodymudskipper

Description

@moodymudskipper

I get integer64 columns when collecting from a postgresql databsewith dplyr/dbplyr, arrange(x) and arrange(desc(x)) work as expected on these columns, but arrange(-x) doesn't.

See below :

library(dplyr,warn.conflicts = FALSE)
df1 <- data.frame(x = letters[1:3], y = c(1,3,2))

identical(arrange(df1, -y), arrange(df1, desc(y)))
#> [1] TRUE

df1$y <- bit64::as.integer64(df1$y)
identical(arrange(df1, -y), arrange(df1, desc(y)))
#> [1] FALSE

# not what I expect
arrange(df1, -y)
#>   x y
#> 1 a 1
#> 2 b 3
#> 3 c 2

Created on 2019-05-16 by the reprex package (v0.2.1)

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions