How to group_by only if the group contains a certain value in a specific column
<p>I have a dataset as follows</p>

<pre><code>Pt    EVENT
123    GGG
123    Nor
123    tre
144    GGG
1667   tre
1667   Nor
1667   tre
</code></pre>

<p>I want to group_by and then the data as per my previous <a href="https://stackoverflow.com/questions/38295137/how-to-transpose-column-and-group-at-the-same-time/38295203#38295203">question</a> according to Pt but I am only interested in creating groups which contain Nor so the final dataset should be </p>

<pre><code>Pt    
123   GGG      Nor   tre
1667  tre      Nor   tre
</code></pre>

<p>I have the answer from the previous question but I can't seem to only select specific <em>groups</em>. This is what I have tried but it gives me</p>

<pre><code>Sankey&lt;-EndoSubset %&gt;%
  group_by(Pt) %&gt;% 
  filter(EVENT == "Nor")
</code></pre>

<p>but obviously this just gives me rows containing Nor whereas I want all the rows for <code>Pt</code> that contains <code>Nor</code></p>