Skip to content

[R-Forge #2607] Filtering by logical column, combined with deleting that column doesn't perform the filter #506

Closed

Description

@arunsrinivasan

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

require(data.table)
DT = data.table(a=1:9, grp=1:3)

DT[ , keep := c(rep(FALSE, .N-1), TRUE), by = grp]
DT[(keep), keep := NULL][] # ignores keep

DT[, keep := c(rep(FALSE, .N-1), TRUE), by = grp]
DT[keep==TRUE, keep := NULL][] # ignores keep

DT[, keep := c(rep(FALSE, .N-1), TRUE), by = grp]
DT[(keep)][, keep := NULL][] # works

Activity

  1. arunsrinivasan commented on Aug 1, 2014

    @arunsrinivasan
    MemberAuthor

    This was fixed to error by @mattdowle in commit 1316 00284c6. Closing and updating README with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions