Skip to content
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

[Request] Verbose message "Assigning to .N row subset of .N rows" seems wrong when x[i] is empty #1808

Closed
franknarf1 opened this issue Aug 11, 2016 · 0 comments
Milestone

Comments

@franknarf1
Copy link
Contributor

I was looking at...

library(data.table)
DT = data.table(a = 1:10)

DT[a < 5, a := 5L, verbose=TRUE]
# Detected that j uses these columns: a 
# Assigning to 4 row subset of 10 rows

DT[a < 5, a := 5L, verbose=TRUE]
# Detected that j uses these columns: a 
# Assigning to 10 row subset of 10 rows

In the second instance, there is (I reckon) no assignment taking place, so it shouldn't look like all rows were modified. Similarly...

DT[0, d := 1, verbose=TRUE]
# Detected that j uses these columns: <none> 
# Assigning to 1 row subset of 10 rows

Here, I would expect to see numbers that better reflect what happened: d was initialized to NA on all rows. Ditto for DT[.(a=11L), on="a", f := 1, verbose=TRUE].

I'm interested in this because my colleagues are coming to R from Stata, which has this sort of feature (reporting counts of rows modified). I don't know if this should be characterized as a FR or bug.

@mattdowle mattdowle added this to the v1.9.8 milestone Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants