Skip to content

as.data.table behavior inconsistent with as.data.frame for matrix list members #833

@ghost

Description

See http://stackoverflow.com/questions/26070187/why-does-data-table-recycle-matrices-into-a-single-vector-when-data-frame-does-n for background.

Reproduce:

a.matrix <- matrix(seq_len(25),ncol = 5, nrow = 5)

a.list <- list(seq_len(5),a.matrix)

a.dt <- as.data.table(a.list)
a.df <- as.data.frame(a.list)
a.dt.df <- as.data.table(a.df)

str(a.dt)
str(a.df) # different from a.dt
str(a.dt.df) # same as a.df

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions