|
64 | 64 |
|
65 | 65 | 9. In `DT[,j,by]`, `by` retains its attributes (e.g. class) when `j` is GForce optimized, [#5567](https://github.com/Rdatatable/data.table/issues/5567). Thanks to @danwwilson for the report, and @ben-schwen for the PR. |
66 | 66 |
|
| 67 | +10. Assigning `list(NULL)` to a list column now replaces the column with `list(NULL)`, instead of deleting the column [#5558](https://github.com/Rdatatable/data.table/issues/5558). This behavior is now consistent with base `data.frame`. Thanks @tdhock for the report and @joshhwuu for the fix. This is due to a fundamental ambiguity from both allowing list columns _and_ making the use of `list()` to wrap `j=` arguments optional. We think that the code behaves as expected in all cases now. See the below for some illustration: |
| 68 | +
|
| 69 | + ```r |
| 70 | + DT = data.table(L=list(1L), i=2L, c='a') |
| 71 | + DT[, i := NULL] # delete i |
| 72 | + DT[, L := NULL] # delete L |
| 73 | +
|
| 74 | + DT[, i := list(NULL)] # delete i |
| 75 | + DT[, L := list(NULL)] # assignment: identical(DT$L, list(NULL)) |
| 76 | +
|
| 77 | + DT[, i := .(3L)] # assignment: identical(DT$i, 3L) |
| 78 | + DT[, L := .(list(NULL))] # assignment: identical(DT$L, list(NULL)) |
| 79 | +
|
| 80 | + DT[, c('L', 'i') := list(NULL, NULL)] # delete L,i |
| 81 | + DT[, c('L', 'i') := list(list(NULL), 3L)] # assignment: identical(DT$L, list(NULL)), identical(DT$i, 3L) |
| 82 | + DT[, c('L', 'i') := list(NULL, 3L)] # delete L, assign to i |
| 83 | + DT[, c('L', 'i') := list(list(NULL), NULL)] # assign to L, delete i |
| 84 | + ``` |
| 85 | +
|
67 | 86 | ## NOTES |
68 | 87 |
|
69 | 88 | 1. `transform` method for data.table sped up substantially when creating new columns on large tables. Thanks to @OfekShilon for the report and PR. The implemented solution was proposed by @ColeMiller1. |
|
100 | 119 |
|
101 | 120 | 16. `print.data.table` gains new argument `show.indices` and option `datatable.show.indices` that allows the user to print a `data.table`'s indices as columns without having to modify the `data.table` itself. Thanks @MichaelChirico for the report and @joshhwuu for the PR. |
102 | 121 |
|
103 | | -17. Assigning `list(NULL)` to a list column now replaces the column with `list(NULL)`, instead of deleting the column [#5558](https://github.com/Rdatatable/data.table/issues/5558). This behavior is now consistent with base `data.frame`. Thanks @tdhock for the report and @joshhwuu for the fix. |
104 | | -
|
105 | 122 | ## TRANSLATIONS |
106 | 123 |
|
107 | 124 | 1. Fix a typo in a Mandarin translation of an error message that was hiding the actual error message, [#6172](https://github.com/Rdatatable/data.table/issues/6172). Thanks @trafficfan for the report and @MichaelChirico for the fix. |
|
0 commit comments