> z <- data.table(x = 1:5, y = 1:5)
> z[["p"]]
NULL
> z[, c("p")]
Error in `[.data.table`(z, , c("p")) : column(s) not found: p
z[["p"]]
does not give error unlike z[, c("p")]
. I do understand the latter needs to return a data.table
while first one returns a vector
. A possible reason seems to be x[, j]
format needs to support multiple columns, and hence it throws error pointing out the issue columns, if any. Can someone confirm this ?