Reprex:
library(data.table)
DT <- data.table(x = 1:5, y = letters[1:5])
setnames(DT, "x", "x y")
DT[, y := "j", keyby = "x y"]
#> Warning in `[.data.table`(DT, , `:=`(y, "j"), keyby = "x y"): := keyby not straightforward character column names or list() of column names, treating as a by:`x y`
Created on 2019-02-09 by the reprex package (v0.2.1)
It should work as it does with by.
Reprex:
Created on 2019-02-09 by the reprex package (v0.2.1)
It should work as it does with
by.