You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[consistency] DT[,0,with=FALSE] should return an empty data.table #1140
It's currently inconsistent with data.frame subsetting:
DF <- data.frame(a=1:5); DT <- data.table(DF)
DF[,0]
# data frame with 0 columns and 5 rows
DT[,0,with=FALSE]
# Error in `[.data.table`(DT, , 0, with = FALSE) : j out of bounds
I don't think it's possible to have a data.table with "0 columns and 5 rows" (as for DF[,0]). Maybe it could return a Null data.table, as [.listof(DT,0) does...?
Activity
franknarf1 commentedon May 6, 2015
Sorry, not sure how to add the consistency tag; and I'm not sure if this is a bug, a feature request or neither.