-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Using as.data.table.data.frame() on a data.frame which inherits from another class leads to an infinite recursion. This seems to have been introduced in #6865 and also came up in #6874. The issue is caused in line 218 in as.data.table.R:
if (!identical(class(x), "data.frame")) return(as.data.table(as.data.frame(x), keep.rownames=keep.rownames, key=key, ...))
# Minimal reproducible example (not executed as this breaks reprex)
df1 <- data.frame(var1 = 1:10)
class(df1) <- c("data.frame", "someClass")
out <- data.table::as.data.table(df1)
Reactions are currently unavailable