You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,28 @@
18
18
19
19
6.`between()` gains the argument `ignore_tzone=FALSE`. Normally, a difference in time zone between `lower` and `upper` will produce an error, and a difference in time zone between `x` and either of the others will produce a message. Setting `ignore_tzone=TRUE` bypasses the checks, allowing both comparisons to proceed without error or message about time zones.
20
20
21
+
7. New helper function `fctr` as an extended version of `factor()`, [#4837](https://github.com/Rdatatable/data.table/issues/4837). Most notably, it supports (1) retaining input level ordering by default, i.e. `levels=unique(x)` as opposed to `levels = sort(unique(x))`; (2) `rev=` to reverse the levels; and (3) `sort=` to allow more feature parity with `factor()`. The choice of default is motivated by convenience in the common case when order of elements needs be preserved, for example when using `dcast` or adding a legend to a plot. This also matches the default sort ordering of groups in `by=`.
dcast(d, id1~ fctr(id2, sort=TRUE)) # same as factor()
34
+
# id1 c d e
35
+
# 1: 1 2 1 3
36
+
# 2: 2 4 5 6
37
+
dcast(d, id1~ fctr(id2, rev=TRUE))
38
+
# id1 e c d
39
+
# 1: 1 3 2 1
40
+
# 2: 2 6 4 5
41
+
```
42
+
21
43
### BUG FIXES
22
44
23
45
1.Custombinaryoperatorsfromthe`lubridate`packagenowworkwithobjectsofclass`IDate`aswitha`Date`subclass, [#6839](https://github.com/Rdatatable/data.table/issues/6839). Thanks @emallickhossain for the report and @aitap for the fix.
@@ -48,7 +70,9 @@
48
70
49
71
14. `data.table()` function is now more aligned with `data.frame()` with respect to the names of the output when one of its inputs is a single-column matrix object, [#4124](https://github.com/Rdatatable/data.table/issues/4124). Thanks @PavoDive for the report and @jangorecki for the PR.
50
72
51
-
15.`cube()`, `rollup()`, and `groupingsets()` no longer produce a spurious warning when using `min()` or `max()` as aggregations, [#6964](https://github.com/Rdatatable/data.table/issues/6964). Thanks @ferenci-tamas for the report and @venom1204 for the fix.
73
+
15. Including an `ITime` object as a named input to `data.frame()` respects the provided name, i.e. `data.frame(a = as.ITime(...))` will have column `a`, [#4673](https://github.com/Rdatatable/data.table/issues/4673). Thanks @shrektan for the report and @MichaelChirico for the fix.
74
+
75
+
16. `cube()`, `rollup()`, and `groupingsets()` no longer produce a spurious warning when using `min()` or `max()` as aggregations, [#6964](https://github.com/Rdatatable/data.table/issues/6964). Thanks @ferenci-tamas for the report and @venom1204 for the fix.
if (is.factor(x[[last_x_idx]]) || is.factor(i[[last_i_idx]]))
34
+
stopf("Attempting roll join on factor column when joining x.%s to i.%s. Only integer, double or character columns may be roll joined.", names(x)[last_x_idx], names(i)[last_i_idx])
35
+
}
36
+
30
37
callersi=i
31
38
i= shallow(i)
32
39
# Just before the call to bmerge() in [.data.table there is a shallow() copy of i to prevent coercions here
if (!x_merge_type %chin% supported) stopf("%s is type %s which is not supported by data.table join", xname, x_merge_type)
66
73
if (!i_merge_type %chin% supported) stopf("%s is type %s which is not supported by data.table join", iname, i_merge_type)
74
+
# we check factors first because they might have different levels
67
75
if (x_merge_type=="factor"||i_merge_type=="factor") {
68
-
if (roll!=0.0&&a==length(icols))
69
-
stopf("Attempting roll join on factor column when joining %s to %s. Only integer, double or character columns may be roll joined.", xname, iname)
70
76
if (x_merge_type=="factor"&&i_merge_type=="factor") {
71
77
if (verbose) catf("Matching %s factor levels to %s factor levels.\n", iname, xname)
72
78
set(i, j=icol, value=chmatch(levels(i[[icol]]), levels(x[[xcol]]), nomatch=0L)[i[[icol]]]) # nomatch=0L otherwise a level that is missing would match to NA values
stopf("Incompatible join types: %s (%s) and %s (%s). Factor columns must join to factor or character columns.", xname, x_merge_type, iname, i_merge_type)
88
94
}
89
-
# we check factors first to cater for the case when trying to do rolling joins on factors
90
95
if (x_merge_type==i_merge_type) {
91
96
if (verbose) catf("%s has same type (%s) as %s. No coercion needed.\n", iname, x_merge_type, xname)
", longdouble.digits==", .Machine$longdouble.digits, # 64 normally, 53 for example under valgrind where some high accuracy tests need turning off, #4639
", capabilities('long.double')==", capabilities('long.double'), # almost certainly overkill, but that's OK; see #6154
234
+
", longdouble.digits==", format(.Machine$longdouble.digits), # 64 normally, 53 for example under valgrind where some high accuracy tests need turning off, #4639
234
235
", sizeof(pointer)==", .Machine$sizeof.pointer,
235
236
", TZ==", if (is.na(tz)) "unset"else paste0("'",tz,"'"),
0 commit comments