Skip to content

order optimization does not recognize all order args properly #4456

Description

@jangorecki

current devel

  • rather uncommon case, a non missing method argument
data.table(x=2:1)[base::order(x, method="auto")]
#   x
#1: 1
#2: 2
data.table(x=2:1)[order(x, method="auto")]
#Error: Column 2 is length 1 which differs from length of column 1 (2)
  • length 1+ decreasing argument
data.table(x=2:1, y=2L)[order(x, y, decreasing=c(FALSE,FALSE))]
#Error: isTRUEorFALSE(decreasing) is not TRUE
d = data.table(x=3:1, y=c(2L,1L,3L), z=1:3)
with(d, order(x, y, decreasing=c(FALSE,FALSE)))
#[1] 3 2 1
d[with(d, order(x, y, decreasing=c(FALSE,FALSE)))] ## order is masked with forder inside outer `d` thus has to be compatible
#Error: isTRUEorFALSE(decreasing) is not TRUE
d[with(d, base::order(x, y, decreasing=c(FALSE,FALSE)))]
#   x y z
#1: 1 3 3
#2: 2 1 2
#3: 3 2 1

Activity

  1. self-assigned this
    on May 17, 2020
  2. changed the title [-]order optimization does recognize all order args properly[/-] [+]order optimization does not recognize all order args properly[/+] on May 18, 2020
  3. added this to the 1.13.5 milestone on Dec 8, 2020
  4. modified the milestones: 1.14.3, on Jul 19, 2022
  5. modified the milestones: , 1.15.1 on Oct 29, 2023
  6. modified the milestones: 1.16.0, 1.17.0 on Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions