We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[.data.table
Submitted by: Michele Carriero; Assigned to: Nobody; R-Forge link
Hi there!
Having a data.table dt like:
dt
dt <- data.table(id=rep(1:2,each=2), var=rnorm(4), key="id")
I would expect the following two expression to give the same type of output
dt[.(1:2), list(var)] # id var #1: 1 0.77227701 #2: 1 1.62441284 #3: 2 -0.04178387 #4: 2 1.20609667 dt[.(1:2), list(var), mult="last"] # var #1: 1.624413 #2: 1.206097
I think having the key column(s) in both expressions is more consistent. The difference is even more noticeable when not using list inside j.
list
j
dt[.(1:4), var] # same than dt[.(1:4), list(var)] because by-without-by dt[.(1:2), var, mult="last"] # [1] 1.624413 1.206097
Regardless of by-without-by methodology is not be used, I think each of the queries above should return the same "type" of output.
by-without-by
The text was updated successfully, but these errors were encountered:
mattdowle
No branches or pull requests
Submitted by: Michele Carriero; Assigned to: Nobody; R-Forge link
Hi there!
Having a data.table
dt
like:I would expect the following two expression to give the same type of output
I think having the key column(s) in both expressions is more consistent. The difference is even more noticeable when not using
list
insidej
.Regardless of
by-without-by
methodology is not be used, I think each of the queries above should return the same "type" of output.The text was updated successfully, but these errors were encountered: