Is there any way to return data.tablewithout j columns?
Quite often, I just need unique combinations of a key or a set of keys.
library(data.table)
wb <- as.data.table(warpbreaks)
wb[ , j = NULL, keyby = list(wool, tension)]
wb[keyby = list(wool, tension)]
subset(wb[ , .N, keyby=list(wool, tension)], select=-N)
unique(wb[ , list(wool, tension)])
thank
source
share