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
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,10 @@
38
38
39
39
1. `data.table(x=1, <expr>)`, where `<expr>` is an expression resulting in a 1-column matrix without column names, will eventually have names `x` and `V2`, not `x` and `V1`, consistent with `data.table(x=1, <expr>)` where `<expr>` results in an atomic vector, for example `data.table(x=1, cbind(1))` and `data.table(x=1, 1)` will both have columns named `x` and `V2`. In this release, the matrix case continues to be named `V1`, but the new behavior can be activated by setting `options(datatable.old.matrix.autoname)` to `FALSE`. See point 5 under Bug Fixes for more context; this change will provide more internal consistency as well as more consistency with `data.frame()`.
40
40
41
-
2. The `week()` function will be fixed in a future release to correctly calculate weeks sequentially (days 1-7 as week 1), which is a potential breaking change. For now, the current (buggy) behavior remains the default. A one-time deprecation warning will be issued when the old and new behaviors differ; this can be suppressed with `options(datatable.warn.week.deprecation = FALSE)`. Users can opt-in to the correct behavior now with the temporary option `options(datatable.week.new = TRUE)`. See [#2611](https://github.com/Rdatatable/data.table/issues/2611) for details. Thanks @MichaelChirico for the report.
41
+
2. The behavior of `week()` will be changed in a future release to calculate weeks sequentially (days 1-7 as week 1), which is a potential breaking change. For now, the current "legacy" behavior remains the default, and a one-time deprecation warning will be issued. Users can control this behavior with the temporary option `options(datatable.week = "...")`:
42
+
* `"sequential"`: Opt-in to the new, sequential behavior (no warning).
43
+
* `"legacy"`: Continue using the legacy behavior but suppress the deprecation warning.
44
+
See [#2611](https://github.com/Rdatatable/data.table/issues/2611) for details. Thanks @MichaelChirico for the report and @venom12_04 for the PR.
warning("The current behavior of data.table::week() is deprecated and will be fixed in a future version to be sequential (day 1-7 is week 1). To opt-in to the new behavior now, run: options(datatable.week.new = TRUE). To suppress this warning, run: options(datatable.warn.week.deprecation = FALSE)");
171
+
if (can_warn&&new_week!=old_week) {
172
+
warning(_("The default behavior of data.table::week() is deprecated. It will be changed to 'sequential' in a future version. To opt-in to the new behavior now, run: options(datatable.week = 'sequential'). To suppress this warning and continue using the legacy behavior, run: options(datatable.week = 'legacy')."));
0 commit comments