title: extracting a new dataframe consisting of top values for all values in a column
body: <p>For example, I'm currently trying to figure out the maximum possible height of a pitcher and catcher duo, so I'm going to use a unique Id for each individual team season and extract the largest value for &quot;height&quot; among both pitchers and catchers.</p>
  <p>here's what I have so far:</p>
  <pre><code>library(Lahman)
  Battery &lt;- Appearances %&gt;% filter(G_p + G_c &gt; 0)
  Battery2 &lt;- left_join(x = Battery,y = People, by = &quot;playerID&quot;) %&gt;% mutate(teamyear = paste0(yearID,teamID)) %&gt;%  select(teamyear,playerID,G_all,G_c,G_p,height) 
  Battery2 &lt;- Battery2 %&gt;% group_by(teamyear)
  Pitcher &lt;- Battery2 %&gt;% filter(G_p &gt; 0)
  Catcher &lt;- Battery2 %&gt;% filter(G_c &gt; 0)
  </code></pre>
  <p>so each row of Pitcher and Catcher is something like</p>
  <p>DET2001 | anderma01 | 62 | 0 | 62 | 76</p>
  <p>and I need to create a new table that only takes the highest value for height among each teamyear ID (e.g. &quot;DET2001&quot; )</p>