Skip to content

merge can't handle custom classes #1378

@ladida771

Description

@ladida771

The result of A and B merge inherits B's custom classes which does not seem intuitive to me at all.

Example:

A=data.table(x=c(1,2,3),y=c(4,5,6))
B=data.table(x=c(1),w=c(5))
class(B) <- c("custom","data.table","data.frame")

C=merge(A,B,by=c('x'))
class(C)

Expecting: "data.table" "data.frame"
Getting: "custom" "data.table" "data.frame"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions