Skip to content

Commit 15f7773

Browse files
committed
y values independent of base::order on data.frame
1 parent 0a16162 commit 15f7773

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

inst/tests/tests.Rraw

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5154,10 +5154,11 @@ test(1318.2, DT[, eval(meanExpr), by = aa], DT[, mean(bb, na.rm=TRUE), by=aa])
51545154
test(1318.3, DT[, list(mySum = eval(sumExpr), myMean = eval(meanExpr)), by = aa], DT[, list(mySum=sum(bb, na.rm=TRUE), myMean=mean(bb, na.rm=TRUE)), by=aa])
51555155

51565156
# get DT[order(.)] to make sense. In v1.12.4 these tests were changed to not be 100% consistent with base in
5157-
# cases where the base R behaviour doesn't make sense, #696
5157+
# cases where the base R behaviour doesn't make sense, #696. In v1.13.4, more y values here were made
5158+
# independent of base R's order on data.frame when that was made an error in R-devel, #4838.
51585159
DT <- data.table(a = 1:4, b = 8:5, c=letters[4:1])
5159-
test(1319.1, DT[order(DT[, "b", with=FALSE])], DT[base::order(DT[, "b", with=FALSE])])
5160-
test(1319.2, DT[order(DT[, "c", with=FALSE])], DT[base::order(DT[, "c", with=FALSE])])
5160+
test(1319.1, DT[order(DT[, "b", with=FALSE])], DT[4:1]) # DT[base::order(DT[, "b", with=FALSE])])
5161+
test(1319.2, DT[order(DT[, "c", with=FALSE])], DT[4:1]) # DT[base::order(DT[, "c", with=FALSE])])
51615162
test(1319.3, DT[order(DT[, c("b","c"), with=FALSE])], DT[4:1]) # DT[base::order(DT[, c("b","c"), with=FALSE])])
51625163
test(1319.4, DT[order(DT[, c("c","b"), with=FALSE])], DT[4:1]) # DT[base::order(DT[, c("c","b"), with=FALSE])])
51635164
test(1319.5, DT[order(DT[, "b", with=FALSE], DT[, "a", with=FALSE])], error="Column 1 passed to [f]order is type 'list', not yet supported")

0 commit comments

Comments
 (0)