How does selecting the 3rd column,
dt[, 3]
>`DT[i, j, by, ...]` which means: “Take DT, subset rows using i, then calculate j ...
I don’t understand how column selection and calculating an expression is the same thing.
So now I can’t figure out if
DT[, sum(V1)]
So for your first example it grabs the third column. The calculation you’re performing is a column selection.
For your second example, you’re returning all the rows, selecting column V1, and summing it.
I really prefer to name the operations
dt[rows, columns, groups]
How does selecting the 3rd column,
jive with>`DT[i, j, by, ...]` which means: “Take DT, subset rows using i, then calculate j ...
I don’t understand how column selection and calculating an expression is the same thing.
So now I can’t figure out if
Will return the column indexed at the sum of V1 or if it will return the sum of the column called V1. How can I tell, from the syntax?