Looking again at #1596 , one point against it is that some folks may be taking advantage of the default V1, V2, ... names, so auto-assigning different names would break their code.
One alternative, that would address my primary use-case, would be for CJ to not need names during a join:
library(data.table)
DT = unique(data.table(datasets::CO2)[, .(Plant, Type, Treatment)])
setkey(DT, Plant, Type)
# good -- no names needed using list
DT[.("Mc1", "Mississippi"), .N, by=.EACHI]
# good -- no names needed using CJ and (implicitly) on = key
DT[CJ(Plant, Type, unique=TRUE), .N, by = .EACHI]
# bad -- breaks for explicit on = key
DT[CJ(Plant, Type, unique=TRUE), on=key(DT)]
# bad -- breaks for on=some-non-key
DT[CJ(Plant, Treatment, unique = TRUE), on=.(Plant, Treatment)]
So I guess I'm asking for an exception in [.data.table that ignores names in i when i=CJ(...), similar to how names are ignored with list inputs or when on= is implicitly the key.
Of course, my desired syntax would also work if FR #1596 went through.
Looking again at #1596 , one point against it is that some folks may be taking advantage of the default V1, V2, ... names, so auto-assigning different names would break their code.
One alternative, that would address my primary use-case, would be for
CJto not need names during a join:So I guess I'm asking for an exception in
[.data.tablethat ignores names iniwheni=CJ(...), similar to how names are ignored with list inputs or whenon=is implicitly the key.Of course, my desired syntax would also work if FR #1596 went through.