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
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@
20
20
21
21
4.Namespace-qualifying`data.table::shift()`, `data.table::first()`, or`data.table::last()`willnotdeactivateGForce, [#5942](https://github.com/Rdatatable/data.table/issues/5942). Thanks @MichaelChirico for the proposal and fix. Namespace-qualifying other calls like `stats::sum()`, `base::prod()`, etc., continue to work as an escape valve to avoid GForce, e.g. to ensure S3 method dispatch.
22
22
23
+
5.`transpose`gains`list.cols=`argument, [#5639](https://github.com/Rdatatable/data.table/issues/5639). Use this to return output with list columns and avoids type promotion (an exception is `factor` columns which are promoted to `character` for consistency between `list.cols=TRUE` and `list.cols=FALSE`). This is convenient for creating a row-major representation of a table. Thanks to @MLopez-Ibanez for the request, and Benjamin Schwendinger for the PR.
24
+
23
25
## BUG FIXES
24
26
25
27
1.`unique()`returnsacopythecasewhen`nrows(x) <= 1`insteadofamutablealias, [#5932](https://github.com/Rdatatable/data.table/pull/5932). This is consistent with existing `unique()` behavior when the input has no duplicates but more than one row. Thanks to @brookslogan for the report and @dshemetov for the fix.
@@ -30,7 +32,9 @@
30
32
31
33
4.`dcast(fill=NULL)`onlycomputesdefaultfillvalueifnecessary, whicheliminatessomeprevious warnings (forexample, whenfun.aggregate=minormax, warningwasNAsintroducedbycoerciontointegerrange) whichwerepotentiallyconfusing, [#5512](https://github.com/Rdatatable/data.table/issues/5512), [#5390](https://github.com/Rdatatable/data.table/issues/5390). Thanks to Toby Dylan Hocking for the fix.
32
34
33
-
3.New`frev(x, copy=TRUE)`asafasteranalogueto`base::rev()`foratomicvectors/lists, [#5885](https://github.com/Rdatatable/data.table/issues/5885). Thanks to Benjamin Schwendinger for suggesting and implementing.
35
+
5.`fwrite(x, row.names=TRUE)`with`x`a`matrix`writes`row.names`whenpresent, notrownumbers, [#5315](https://github.com/Rdatatable/data.table/issues/5315). Thanks to @Liripo for the report, and @ben-schwen for the fix.
36
+
37
+
6.New`frev(x, copy=TRUE)`asafasteranalogueto`base::rev()`foratomicvectors/lists, [#5885](https://github.com/Rdatatable/data.table/issues/5885). Thanks to Benjamin Schwendinger for suggesting and implementing.
\item{keep.names}{Thenameofthefirstcolumnintheresultcontainingthenamesoftheinput; e.g. \code{keep.names="rn"}.Bydefault \code{NULL} andthenamesoftheinputarediscarded.}
16
17
\item{make.names}{Thenameornumberofacolumnintheinputtouseasnamesoftheoutput; e.g. \code{make.names="rn"}.Bydefault \code{NULL} anddefaultnamesaregiventotheoutputcolumns.}
Copy file name to clipboardExpand all lines: vignettes/datatable-faq.Rmd
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -400,6 +400,7 @@ A key advantage of column vectors in R is that they are _ordered_, unlike SQL[^2
400
400
-`check.names` is by default `TRUE` in `data.frame` but `FALSE` in data.table, for convenience.
401
401
-`data.table` has always set `stringsAsFactors=FALSE` by default. In R 4.0.0 (Apr 2020), `data.frame`'s default was changed from `TRUE` to `FALSE` and there is no longer a difference in this regard; see [stringsAsFactors, Kurt Hornik, Feb 2020](https://developer.r-project.org/Blog/public/2020/02/16/stringsasfactors/).
402
402
- Atomic vectors in `list` columns are collapsed when printed using `", "` in `data.frame`, but `","` in data.table with a trailing comma after the 6th item to avoid accidental printing of large embedded objects.
403
+
- Unlike data.frames a data.table cannot store rows with no columns, as rows are considered to be the children of columns: `nrow(DF[, 0])` returns the number of rows, while `nrow(DT[, 0])` always returns 0; but see issue [#2422](https://github.com/Rdatatable/data.table/issues/2422).
403
404
404
405
In `[.data.frame` we very often set `drop = FALSE`. When we forget, bugs can arise in edge cases where single columns are selected and all of a sudden a vector is returned rather than a single column `data.frame`. In `[.data.table` we took the opportunity to make it consistent and dropped `drop`.
0 commit comments