Skip to content

[R-Forge #1841] Implement a fast droplevels.data.table method. #647

@arunsrinivasan

Description

@arunsrinivasan

Submitted by: Steve Lianoglou; Assigned to: Nobody; R-Forge link

The default droplevels.data.frame function is invoked on a call to droplevels on a data.table. This results in borken output from droplevels, eg. as reported by pchalasani on the ML:

d <- data.table(name = c('a','b','c'), value = 1:3)
dt <- data.table(d)
setkey(dt,'name')
dt1 <- subset(dt,name != 'a') # or dt1 <- dt[ name != 'a' ]

dt1
name value
[1,] b 2
[2,] c 3

droplevels(dt1)
name value
[1,] b 1
[2,] c 3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions