|
10 | 10 |
|
11 | 11 | ### NEW FEATURES |
12 | 12 |
|
13 | | -1. New `sort_by()` method for data.tables, [#6662](https://github.com/Rdatatable/data.table/issues/6662). It uses `forder()` to improve upon the data.frame method and also match `DT[order(...)]` behavior with respect to locale. Thanks @rikivillalba for the suggestion and PR. |
| 13 | +1. New `sort_by()` method for data.tables, [#6662](https://github.com/Rdatatable/data.table/issues/6662). It uses `forder()` to improve upon the data.frame method and also matches `DT[order(...)]` behavior with respect to locale. Thanks @rikivillalba for the suggestion and PR. |
| 14 | + |
| 15 | + ```r |
| 16 | + DT = data.table(a=c(1L, 2L, 1L), b=c(3L, 1L, 2L)) |
| 17 | + sort_by(DT, ~a + b) |
| 18 | + # a b |
| 19 | + # 1: 1 2 |
| 20 | + # 2: 1 3 |
| 21 | + # 3: 2 1 |
| 22 | + ``` |
14 | 23 |
|
15 | 24 | 2. `melt()` now supports using `patterns()` with `id.vars`, [#6867](https://github.com/Rdatatable/data.table/issues/6867). Thanks to Toby Dylan Hocking for the suggestion and PR. |
16 | 25 |
|
|
87 | 96 | # 2: 2 b e <NA> |
88 | 97 | # 3: 3 c <NA> h |
89 | 98 | ``` |
| 99 | +14. `fcoalesce()` and `setcoalesce()` gain `nan` argument to control whether `NaN` values should be treated as missing (`nan=NA`, the default) or non-missing (`nan=NaN`), [#4567](https://github.com/Rdatatable/data.table/issues/4567). This provides full compatibility with `nafill()` behavior. Thanks to @ethanbsmith for the feature request and @Mukulyadav2004 for the implementation. |
| 100 | + |
| 101 | +15. New function `isoyear()` has been implemented as a complement to `isoweek()`, returning the ISO 8601 year corresponding to a given date, [#7154](https://github.com/Rdatatable/data.table/issues/7154). Thanks to @ben-schwen and @MichaelChirico for the suggestion and @venom1204 for the implementation. |
90 | 102 |
|
91 | 103 | ### BUG FIXES |
92 | 104 |
|
|
106 | 118 |
|
107 | 119 | 8. A data.table with a column of class `vctrs_list_of` (from package {vctrs}) prints as expected, [#5948](https://github.com/Rdatatable/data.table/issues/5948). Before, they could be printed messily, e.g. printing every entry in a nested data.frame. Thanks @jesse-smith for the report, @DavisVaughan and @r2evans for contributing, and @MichaelChirico for the PR. |
108 | 120 |
|
109 | | -9. Fixed incorrect sorting of merges where the first column of a key is a factor with non-`sort()`-ed levels (e.g. `factor(1:2, 2:1)` and it is joined to a character column, [#5361](https://github.com/Rdatatable/data.table/issues/5361). Thanks to @gbrunick for the report and Benjamin Schwendinger for the fix. |
| 121 | +9. Fixed incorrect sorting of merges where the first column of a key is a factor with non-`sort()`-ed levels (e.g. `factor(1:2, 2:1)` and it is joined to a character column, [#5361](https://github.com/Rdatatable/data.table/issues/5361). Thanks to @gbrunick for the report, Benjamin Schwendinger for the fix, and @MichaelChirico for a follow-up fix caught by revdep testing. |
110 | 122 |
|
111 | 123 | 10. Spurious warnings from internal code in `cube()`, `rollup()`, and `groupingsets()` are no longer surfaced to the caller, [#6964](https://github.com/Rdatatable/data.table/issues/6964). Thanks @ferenci-tamas for the report and @venom1204 for the fix. |
112 | 124 | |
|
118 | 130 |
|
119 | 131 | 14. Filling columns of class Date with POSIXct (and vice versa) using `shift()` now yields a clear, informative error message specifying the class mismatch, [#5218](https://github.com/Rdatatable/data.table/issues/5218). Thanks @ashbaldry for the report and @ben-schwen for the fix. |
120 | 132 |
|
| 133 | +15. `split.data.table()` output list elements retain the S3 class of the generating data.table, e.g. in `l=split(x, ...)` if `x` has class `my_class`, so will `l[[1]]` and so on, [#7105](https://github.com/Rdatatable/data.table/issues/7105). Thanks @m-muecke for the bug report and @MichaelChirico for the fix. |
| 134 | +
|
| 135 | +16. `between()` is now more robust with `integer64` arguments. Combining small integer `x` with certain large `integer64` bounds no longer misinterprets the bounds as `double`; if a `double` bound cannot be losslessly converted into `integer64` for comparison with `integer64` `x`, an error is signalled instead of returning a wrong answer with a warning; [#7164](https://github.com/Rdatatable/data.table/issues/7164). Thanks @aitap for the bug report and the fix. |
| 136 | +
|
| 137 | +17. `t1 - t2`, where one is an `IDate` and the other is a `Date`, are now consistent with the case where both are `IDate` or both are `Date`, [#4749](https://github.com/Rdatatable/data.table/issues/4749). Thanks @George9000 for the report and @MichaelChirico for the fix. |
| 138 | +
|
| 139 | +18. `fwrite` now allows `dec` to be the same as `sep` for edge cases where only one will be written, e.g. 0-row or 1-column tables. [#7227](https://github.com/Rdatatable/data.table/issues/7227). Thanks @MichaelChirico for the report and @venom1204 for the fix. |
| 140 | +
|
121 | 141 | ### NOTES |
122 | 142 |
|
123 | 143 | 1. The following in-progress deprecations have proceeded: |
|
139 | 159 |
|
140 | 160 | 5. A GitHub Actions workflow is now in place to warn the entire maintainer team, as well as any contributor following the GitHub repository, when the package is at risk of archival on CRAN [#7008](https://github.com/Rdatatable/data.table/issues/7008). Thanks @tdhock for the original report and @Bisaloo and @TysonStanley for the fix. |
141 | 161 |
|
142 | | -# data.table [v1.17.8](https://github.com/Rdatatable/data.table/milestone/41) (6 July 2025) |
| 162 | +6. Using a double vector in `set()`'s `i=` and/or `j=` no longer throws a warning about preferring integer, [#6594](https://github.com/Rdatatable/data.table/issues/6594). While it may improve efficiency to use integer, there's no guarantee it's an improvement and the difference is likely to be minimal. The coercion will still be reported under `datatable.verbose=TRUE`. For package/production use cases, static analyzers such as `lintr::implicit_integer_linter()` can also report when numeric literals should be rewritten as integer literals. |
| 163 | + |
| 164 | +## data.table [v1.17.8](https://github.com/Rdatatable/data.table/milestone/41) (6 July 2025) |
143 | 165 |
|
144 | 166 | 1. Internal functions used to signal errors are now marked as non-returning, silencing a compiler warning about potentially unchecked allocation failure. Thanks to Prof. Brian D. Ripley for the report and @aitap for the fix, [#7070](https://github.com/Rdatatable/data.table/pull/7070). |
145 | 167 |
|
146 | | -# data.table [v1.17.6](https://github.com/Rdatatable/data.table/milestone/40) (15 June 2025) |
| 168 | +## data.table [v1.17.6](https://github.com/Rdatatable/data.table/milestone/40) (15 June 2025) |
147 | 169 |
|
148 | 170 | 1. On a heavily loaded machine, a `forder` thread could try to perform a zero-length copy from a null pointer, which was de-facto harmless but is against the C standard and was caught by additional CRAN checks, [#7051](https://github.com/Rdatatable/data.table/issues/7051). Thanks to @helske for the report and @aitap for the PR. |
149 | 171 |
|
150 | | -# data.table [v1.17.4](https://github.com/Rdatatable/data.table/milestone/39) (25 May 2025) |
| 172 | +## data.table [v1.17.4](https://github.com/Rdatatable/data.table/milestone/39) (25 May 2025) |
151 | 173 |
|
152 | 174 | 1. The C code now avoids passing invalid data pointers from 0-length vectors to `memcpy()`, which previously caused undefined behaviour. Thanks to Prof. Brian D. Ripley for the report and Michael Chirico for the fix, [#6911](https://github.com/Rdatatable/data.table/pull/6911). |
153 | 175 |
|
154 | | -# data.table [v1.17.2](https://github.com/Rdatatable/data.table/milestone/38) (7 May 2025) |
| 176 | +## data.table [v1.17.2](https://github.com/Rdatatable/data.table/milestone/38) (7 May 2025) |
155 | 177 |
|
156 | | -## BUG FIXES |
| 178 | +### BUG FIXES |
157 | 179 |
|
158 | 180 | 1. `fwrite(compress="gzip")` once again produces a gzip header when the column names are missing or disabled, [@6852](https://github.com/Rdatatable/data.table/issues/6852). Thanks @maxscheiber for the report and @aitap for the fix. |
159 | 181 |
|
|
169 | 191 |
|
170 | 192 | 7. `as.data.table()` now properly handles keys: specifying keys sets them, omitting keys preserves existing ones, and setting `key=NULL` clears them, [#6859](https://github.com/Rdatatable/data.table/issues/6859). Thanks @brookslogan for the report and @Mukulyadav2004 for the fix. |
171 | 193 |
|
172 | | -## NOTES |
| 194 | +### NOTES |
173 | 195 |
|
174 | 196 | 1. Continued work to remove non-API C functions, [#6180](https://github.com/Rdatatable/data.table/issues/6180). Thanks Ivan Krylov for the PRs and for writing a clear and concise guide about the R API: https://aitap.codeberg.page/R-api/. |
175 | 197 |
|
|
0 commit comments