title: Split aggregated data table into multiple CSV files
body: <p>I have a data table with may rows containing data about usage of some specific services. This data describes the usage of different service types in different regions:</p>
  
  <pre><code>type     region     quantity     timestamp
  small     A            2         05/01/15
  small     B            1         05/01/15
  big       A            1         05/01/15
  small     A            2         06/01/15
  small     B            1         06/01/15
  big       A            3         06/01/15
  ...etc
  </code></pre>
  
  <p>I am performing some operations over the data series of every unique combination of type and region (each of these combinations produce its own time series so <code>small-A</code> should be treated independently from <code>small-B</code>, for example)</p>
  
  <p>I already figured out how to do these kind of operations with aggregated data like this:</p>
  
  <pre><code>aggregatedDT &lt;- DT[, .(quant = sum(quantity)), by = .(week, region,type)]
  </code></pre>
  
  <p>Now I need to save each data series into a separate CSV file. I am not sure if there are some built-in functionality to do such operation so I would like to know whether this is even possible.</p>
  
  <p>My desired output would be:</p>
  
  <p><strong>small-A.csv</strong>:</p>
  
  <pre><code>week1: total quantity
  week2: total quantity
  ...
  </code></pre>
  
  <p>And the same thing for <strong>small-B.csv</strong>, <strong>big-A.csv</strong> etc. Athe the moment, I have these data in one aggregated data.table but these csv files are meant as an input for another algorithm which needs to take the timeseries one by one.</p>