title: forming clusters/groups in a dataset based on unique values from some of the columns using R
body: <p>I have a following dataset, this is a sample dataset which depicts the Products and its features(in each columns). It contains 12 features/columns for the 21 Products/records.</p>
  <pre><code>Data.df &lt;- structure(list(Product.group = c(&quot;A Box&quot;, &quot;A Box&quot;, &quot;A Box&quot;, &quot;A Box&quot;, 
  &quot;A Box&quot;, &quot;A Box&quot;, &quot;A Box&quot;, &quot;A Box&quot;, &quot;B Box&quot;, &quot;B Box&quot;, &quot;B Box&quot;, 
  &quot;B Box&quot;, &quot;B Box&quot;, &quot;B Box&quot;, &quot;B Box&quot;, &quot;B Box&quot;, &quot;C Box&quot;, &quot;C Box&quot;, 
  &quot;C Box&quot;, &quot;C Box&quot;, &quot;C Box&quot;), Performance = c(&quot;High&quot;, &quot;High&quot;, &quot;High&quot;, 
  &quot;Medium&quot;, &quot;Medium&quot;, &quot;Low&quot;, &quot;Low&quot;, &quot;Low&quot;, &quot;High&quot;, &quot;High&quot;, &quot;High&quot;, 
  &quot;High&quot;, &quot;Low&quot;, &quot;Low&quot;, &quot;Low&quot;, &quot;Medium&quot;, &quot;High&quot;, &quot;High&quot;, &quot;Low&quot;, 
  &quot;Low&quot;, &quot;Low&quot;), Family = c(&quot;A1&quot;, &quot;A1&quot;, &quot;A1&quot;, &quot;A1&quot;, &quot;A1&quot;, &quot;A2&quot;, 
  &quot;A2&quot;, &quot;A2&quot;, &quot;B1&quot;, &quot;B1&quot;, &quot;B1&quot;, &quot;B1&quot;, &quot;B1&quot;, &quot;B2&quot;, &quot;B2&quot;, &quot;B1&quot;, &quot;C1&quot;, 
  &quot;C2&quot;, &quot;C1&quot;, &quot;C1&quot;, &quot;C2&quot;), Product.ID = c(&quot;A111&quot;, &quot;A112&quot;, &quot;A113&quot;, 
  &quot;A114&quot;, &quot;A118&quot;, &quot;A211&quot;, &quot;A222&quot;, &quot;A347&quot;, &quot;AX12&quot;, &quot;AX14&quot;, &quot;AX16&quot;, 
  &quot;AX18&quot;, &quot;AY78&quot;, &quot;AY89&quot;, &quot;AY91&quot;, &quot;B122&quot;, &quot;AA11&quot;, &quot;AA32&quot;, &quot;AA43&quot;, 
  &quot;AC21&quot;, &quot;AC43&quot;), Function = c(&quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, 
  &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;GAS&quot;, &quot;GAS&quot;, 
  &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;ELEC&quot;, &quot;GAS&quot;, &quot;GAS&quot;, &quot;GAS&quot;, &quot;GAS&quot;, &quot;GAS&quot;
  ), Voltage = c(&quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, 
  &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;, &quot;G&quot;), Gas.stage = c(NA, 
  NA, NA, NA, NA, NA, NA, NA, NA, NA, &quot;A112&quot;, &quot;A112&quot;, NA, NA, NA, 
  NA, &quot;A150&quot;, &quot;A150&quot;, &quot;A240&quot;, &quot;A240&quot;, &quot;A240&quot;), Electric = c(NA, 
  NA, &quot;22KW&quot;, NA, NA, NA, NA, NA, &quot;22KW&quot;, NA, NA, NA, NA, NA, &quot;7.5KW&quot;, 
  NA, NA, NA, NA, NA, NA), Drive = c(&quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, 
  &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, 
  &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, 
  &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;, &quot;Direct&quot;), Exhaust = c(NA, NA, 
  NA, NA, NA, &quot;Single&quot;, NA, NA, NA, NA, &quot;Single&quot;, NA, NA, NA, NA, 
  NA, &quot;Single&quot;, NA, NA, &quot;Double&quot;, &quot;Double&quot;), Fuse = c(&quot;15A&quot;, &quot;15A&quot;, 
  &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, 
  &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;15A&quot;, &quot;20A&quot;, NA, &quot;15A&quot;
  ), Accessory = c(NA, NA, NA, NA, NA, &quot;Installed&quot;, NA, NA, NA, 
  NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, &quot;Installed&quot;, NA)), row.names = c(NA, 
  21L), class = &quot;data.frame&quot;)
  
  </code></pre>
  <p>Is there a way to subset this dataset into multiple groups based on unique values from some of the columns/features. The columns that are used for grouping are</p>
  <ol>
  <li>Product group</li>
  <li>Performance</li>
  <li>Family</li>
  <li>Function</li>
  <li>Voltage</li>
  </ol>
  <p>Need to subset the entire data based on unique values from these columns in the same order mentioned as above and give this subset an unique group id.</p>
  <p>I have just started learning about clustering and it would be of great help if anyone could advise on this.</p>
  <p>Thank you</p>