Skip to content

[R-Forge #5191] Some operations in by= are applied to data.table before j is evaluated #497

Closed

Description

@arunsrinivasan

Submitted by: Garrett See; Assigned to: Nobody; R-Forge link

Note that in the output below the values in V1 are only 6 digits long

library(data.table)
dat <- data.table(Date=c(20131101:20131130, 20131201:20131231))
dat[, last(Date), by=Date %/% 100L]
#      Date     V1
#1: 201311 201311
#2: 201312 201312

I thought it should give the same results as this:

dat[, last(Date), by=substr(Date, 1, 6)]
#    substr       V1
#1: 201311 20131130
#2: 201312 20131231

Activity

  1. added this to the v1.9.6 milestone on Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions