title: Create list of elements which match a value
body: <p>I have a table of values with the name, zipcode and opening date of recreational pot shops in WA state. </p>
  
  <pre><code>                             name   zip    opening
  1                   The Stash Box 98002 2014-11-21
  3                       Greenside 98198 2015-01-01
  4                      Bud Nation 98106 2015-06-29
  5       West Seattle Cannabis Co. 98168 2015-02-28
  6                     Nimbin Farm 98168 2015-04-25
  ...
  </code></pre>
  
  <p>I'm analyzing this data to see if there are any correlations between drug usage and location and opening of recreational stores. For one of the visualizations I'm doing, I am organizing the data by number of shops per zipcode using the <code>group_by()</code> and <code>summarize()</code> functions in <code>dplyr</code>. </p>
  
  <pre><code>     zip count
      (int) (int)
  1  98002     1
  2  98106     1
  3  98168     2
  4  98198     1
  ...
  </code></pre>
  
  <p>This data is then plotted onto a leaflet map. Showing the relative number of shops in a zipcode using the radius of the circles to represent shops. </p>
  
  <p><a href="https://i.stack.imgur.com/uHEA6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uHEA6.png" alt="Pot Shops in King County"></a></p>
  
  <p>I would like to reorganize the <code>name</code> variable into a third column so that this can popup in my visualization when scrolling over each circle. Ideally, the data would look something like this:</p>
  
  <pre><code>     zip count                                    name
      (int) (int)                            (character)
  1  98002     1                           The Stash Box
  2  98106     1                              Bud Nation
  3  98168     2  Nimbin Farm, West Seattle Cannabis Co.
  4  98198     1                               Greenside
  ...
  </code></pre>
  
  <p>Where all shops in the same zipcode appear together in the third column together. I've tried various for loops and if statements but I'm sure there is a better way to do this and my R skills are just not up there yet. Any help would be appreciated.</p>