Skip to content

Commit 0269583

Browse files
update fix
1 parent 2583d6e commit 0269583

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

R/as.data.table.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ as.data.table.data.table = function(x, ...) {
254254
x = copy(x) # #1681
255255
# fix for #1078 and #1128, see .resetclass() for explanation.
256256
setattr(x, 'class', .resetclass(x, "data.table"))
257-
if (!is.null(key)) {
258-
setkeyv(x, key)
259-
} else {
260-
setkey(x, NULL)
261-
}
257+
if (!missing(key)) setkeyv(x, key)
262258
x
263259
}

0 commit comments

Comments
 (0)