Skip to content

Commit 83909d9

Browse files
walk back update for check.names default
1 parent 684efa5 commit 83909d9

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
13. In rare cases, `data.table` failed to expand ALTREP columns when assigning a full column by reference. This could result in the target column getting modified unintentionally if the next call to the data.table was a modification by reference of the source column. E.g. in `DT[, b := as.character(a)]` the string conversion gets deferred and subsequent modification of column `a` would also modify column `b`, [#5400](https://github.com/Rdatatable/data.table/issues/5400). Thanks to @aquasync for the report and Václav Tlapák for the PR.
4848

49-
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). We also prevent returning duplicate names for matrix column inputs, [#3193](https://github.com/Rdatatable/data.table/issues/3193). Thanks @PavoDive and @MichaelChirico for the reports and @jangorecki for the PR.
49+
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.
5050

5151
### NOTES
5252

R/data.table.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ data.table = function(..., keep.rownames=FALSE, check.names=FALSE, key=NULL, str
5050
names(x) = nd$vnames
5151
if (length(x)==0L) return( null.data.table() )
5252
if (length(x)==1L && (is.null(x[[1L]]) || (is.list(x[[1L]]) && length(x[[1L]])==0L))) return( null.data.table() ) #48
53-
if (missing(check.names)) check.names = NULL ## inherit missingness #3193
5453
ans = as.data.table.list(x, keep.rownames=keep.rownames, check.names=check.names, .named=nd$.named) # see comments inside as.data.table.list re copies
5554
if (!is.null(key)) {
5655
if (!is.character(key)) stopf("key argument of data.table() must be character")

inst/tests/tests.Rraw

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21234,6 +21234,3 @@ test(2321.1, DT <- data.table(a=1:2, b=matrix(1:2)), data.table(a=1:2, b=1:2))
2123421234
test(2321.2, names(DT), names(data.frame(a=1:2, b=matrix(1:2))))
2123521235
test(2321.3, DT <- data.table(a=integer(), b=matrix(1L, nrow=0L, ncol=1L)), data.table(a=integer(), b=integer()))
2123621236
test(2321.4, names(DT), names(data.frame(a=integer(), b=matrix(1L, nrow=0L, ncol=1L))))
21237-
# data.table(vector, matrix) can return duplicate column names #3193
21238-
test(2321.5, anyDuplicated(names(data.table(1:5, matrix(6:15, nrow = 5L)))), 0L)
21239-
test(2321.6, anyDuplicated(names(data.table(integer(), matrix(1L, nrow=0L, ncol=2L)))), 0L)

0 commit comments

Comments
 (0)