(After a brief discussion with Matt)
The behaviour with=FALSE:
require(data.table)
DT = data.table(x=1:5, y=6:10, z=11:15)
DT[, c("y", "z"), with=FALSE]
In talking to colleagues, and at meetings or over emails, it seems that restoring the data.frame behaviour only for those cases where j is integer/character vector can only bring more sanity (trading inconsistency).
The issue is that data.table usage revolves around [ a lot, and therefore users are confronted with having to learn this difference quite early, and having to learn new syntax for a known basic operation doesn't sit well. It also doesn't seem to help in explaining how a data.table is a data.frame with this basic operation.
AFAICT, there's no real usage to having just character/integer vectors in j. Therefore, it'd be great to have with=FALSE being unnecessary and be able to subset columns the data.frame way:
DT[, c("y", "z")]
DT[, 2:3]
The default return of vector in case of only one column and use of drop=FALSE should also be restored. This'll help get over the basic data.frame like usage very quickly without having to wonder "why", and start learning the actual essential enhanced-ness data.table provides.
It'd be great to hear thoughts from other users as well.
This has come up before (raised by Matt) : http://r.789695.n4.nabble.com/with-FALSE-td4589266.html but 'leave it as it is' was the response more or less.
(After a brief discussion with Matt)
The behaviour
with=FALSE:In talking to colleagues, and at meetings or over emails, it seems that restoring the data.frame behaviour only for those cases where
jis integer/character vector can only bring more sanity (trading inconsistency).The issue is that
data.tableusage revolves around[a lot, and therefore users are confronted with having to learn this difference quite early, and having to learn new syntax for a known basic operation doesn't sit well. It also doesn't seem to help in explaining how a data.table is a data.frame with this basic operation.AFAICT, there's no real usage to having just character/integer vectors in
j. Therefore, it'd be great to havewith=FALSEbeing unnecessary and be able to subset columns the data.frame way:The default return of vector in case of only one column and use of
drop=FALSEshould also be restored. This'll help get over the basic data.frame like usage very quickly without having to wonder "why", and start learning the actual essential enhanced-ness data.table provides.It'd be great to hear thoughts from other users as well.
This has come up before (raised by Matt) : http://r.789695.n4.nabble.com/with-FALSE-td4589266.html but 'leave it as it is' was the response more or less.