I am trying to do some aggregations in a data.table and I am facing one challenge that cannot find the solution for. The challenge is really simple, I would like to summarise some of the values in the data.table along more than one dimension.
I have no problems getting the following code to work:
Export4R[,sum(units),by=Type]
This gives something along the following lines:
Type Value
foobar 45
barfoo 25
But now I like to break it a bit down a bit further and hope to get a table like this:
Type Month Value
foobar Mar 12
foobar Apr 7
....
I tried to do this with a line of code like, but unfortunately this doesn't seem to work:
Export4R[,sum(units),by=Type,Month]
This is most likely a very simple issues, but I have problems finding the answer.
Thanks for the assistance!