title: R: Generate tables based on Distinct Values
body: <p>Good Morning, Community:</p>
  
  <p>I have this table, which contains demand for specific items, on a given location and a given date:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;blockquote class="imgur-embed-pub" lang="en" data-id="a/RAoXIbW"&gt;&lt;a href="//imgur.com/RAoXIbW"&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;script async src="//s.imgur.com/min/embed.js" charset="utf-8"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Assuming the demand is already grouped (Sum) by Date, Product ID and Location ID, is there a way of generating several tables based distinct Product IDs and Location IDs, containing their respective demand in R?</p>
  
  <p>This how it would look like for product "a" on location "3":</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;blockquote class="imgur-embed-pub" lang="en" data-id="a/wv1hBxP"&gt;&lt;a href="//imgur.com/wv1hBxP"&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;script async src="//s.imgur.com/min/embed.js" charset="utf-8"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance.</p>