require(data.table) # devel compiled on 3rd March 2018
dt <- data.table(x=1:5, y=6:10, z=11:15)
# x y z
# 1: 1 6 11
# 2: 2 7 12
# 3: 3 8 13
# 4: 4 9 14
# 5: 5 10 15
Now we can subset cols using the .. notation conveniently as follows:
cols <- "z"
dt[, ..cols]
# z
# 1: 11
# 2: 12
# 3: 13
# 4: 14
# 5: 15
Since ..var has a very special meaning, we could also allow this?
Currently, it errors as follows:
# Error in eval(jsub, SDenv, parent.frame()) : object '..cols' not found
Haven't really given it a lot of thought.. Just came across it and wanted to file it as an issue so that it doesn't get lost.
Now we can subset cols using the
..notation conveniently as follows:Since
..varhas a very special meaning, we could also allow this?Currently, it errors as follows:
# Error in eval(jsub, SDenv, parent.frame()) : object '..cols' not foundHaven't really given it a lot of thought.. Just came across it and wanted to file it as an issue so that it doesn't get lost.