title: Finding Largest Element of a Matrix in R
body: <p>I am using R for the first time and need to write a function that takes in a matrix with 2 columns. For example</p>
  
  <pre><code>col1 col2
    2   0.2
    3   0.2
    4   0.3
    5   0.1
    6   0.2
  </code></pre>
  
  <p>Based on which number is highest in col2 (which is 0.3), I need to return the corresponding number in col1 (which is 4). How can I go about doing this in R?</p>