-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing behavior with DT[, min(var):max(var)] #2069
Comments
This behavior looks quite inconsistent with data.table's evaluation rules. |
Seems like a bug to me. In particular, note:
Indeed it's something funky with scoping rules, as this fixes things to work as expected:
But it certainly seems like an unnatural workaround... |
Here's the culprit:
The logic isn't robust enough to allow for I'm not sure if there's a simple way to fix the logic to accommodate this and still set And anyway, I still have no idea why/how the output is what it is, given that |
@MichaelChirico I'm guessing it's somehow becoming This produces the same result:
and
|
What about only |
With this data...
I expected
DT[, min(t):max(t)]
to be the same aswith(DT, min(t):max(t))
-- just a vector of integers counting over that interval. I got something quite different:Maybe this is a side-effect of the move to make
DT[, j]
behave more likeDF[, j]
? I didn't check to see if it also happened in older versions.The text was updated successfully, but these errors were encountered: