I am looking for the data.table equivalent of the following SQL query:
select date, item, count(value) from dataset group by date, item
So far, what I've got is this:
dataset[, .SD, by = c("date", "item", "value")]
However, this is giving me the number of rows for each value. I'm not sure how to specify that I want the number of values for each item, for each date. How can I achieve this?