Skip to content

Incomplete dox in ?setorder #1920

@MichaelChirico

Description

@MichaelChirico

In ?setorder::Usage, we have:

# optimised to use data.table's internal fast order
# x[order(., na.last=TRUE)]

But x[order(., decreasing = TRUE)] is also optimized. Using the example from ?setorder:

set.seed(45L)
DT = data.table(A=sample(3, 10, TRUE), 
         B=sample(letters[1:3], 10, TRUE), C=sample(10))
DT[order(C, decreasing = TRUE), verbose = TRUE]
# order optimisation is on, i changed from 'order(...)' to 'forder(DT, ...)'.
#     A B  C
#  1: 1 b 10
#  2: 2 a  9
#  3: 2 b  8
#  4: 1 a  7
#  5: 2 b  6
#  6: 1 a  5
#  7: 1 c  4
#  8: 1 c  3
#  9: 2 b  2
# 10: 1 b  1

So I guess the documentation should mention this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions