Skip to content

Commit 42f7ea7

Browse files
committed
add fix for S4
1 parent fa16740 commit 42f7ea7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/data.table.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,6 +2942,8 @@ setDT = function(x, keep.rownames=FALSE, key=NULL, check.names=FALSE) {
29422942
} else if (is.list(x) && length(x)==1L && is.matrix(x[[1L]])) {
29432943
# a single list(matrix) is unambiguous and depended on by some revdeps, #3581
29442944
x = as.data.table.matrix(x[[1L]])
2945+
} else if (is.list(x) && length(x)==1L && isS4(x[[1L]])) {
2946+
x = as.data.table.data.frame(as.data.frame(x[[1L]]))
29452947
} else if (is.null(x) || (is.list(x) && !length(x))) {
29462948
x = null.data.table()
29472949
} else if (is.list(x)) {

0 commit comments

Comments
 (0)