Skip to content

split.data.table does not preserve attributes #2047

@caneff

Description

@caneff

data.table 1.10.5, R 3.2.2.

split.data.frame preserves attributes from the original, but split.data.table drops them.

library(data.table)
dt=data.table(x=1:10)
setattr(dt, "a", 5)
attr(split(dt,rep(1:2,each=5))[[1]],"a")
# NULL (expect 5)
attr(split.data.frame(dt,rep(1:2,each=5))[[1]],"a")
# 5

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions