title: how to create a dummy variable for value in top quartile (or other quantile)
body: <p>Simple R question here, and a little similar to <a href="https://stackoverflow.com/questions/7508229/how-to-create-a-column-with-a-quartile-rank">this one</a> but I couldn't figure out how to adapt the insights from there into my setting.</p>
  
  <p>I have a dataframe with relative quality rankings from several firms, e.g.</p>
  
  <pre><code>Firm    Quality
    A        4
    B        5
    C        2
    D        0
  </code></pre>
  
  <p>I want to add a third column that is 1 if quality is at or above the 50th percentile (and 0 otherwise), and a fourth column that is 1 if quality is at or above the 75th percentile (and 0 otherwise). Solutions like the one linked above seem to rely on <code>cut()</code> and <code>within()</code>; they are relatively old though, pre-dplyr, and I'm wondering if there's a good way to use <code>summarise()</code> and the dplyr summary functions to do this in a way that is more intuitive (at least for this newbie).</p>