title: How to remove rows of a matrix by row name, rather than numerical index?
body: <p>I have matrix <strong>g</strong>:</p>
  
  <pre><code>&gt; g[1:5,1:5]
          rs7510853 rs10154488 rs12159982 rs2844887 rs2844888
  NA06985 "CC"      "CC"       "CC"       "CC"      "CC"     
  NA06991 "CC"      "CC"       "CC"       "CC"      "CC"     
  NA06993 "CC"      "CC"       "CC"       "CC"      "CC"     
  NA06994 "CC"      "CC"       "CC"       "CC"      "CC"     
  NA07000 "CC"      "CC"       "CC"       "CC"      "CC"     
  &gt; rownames(g)[1:2]-&gt;remove
  &gt; remove
  [1] "NA06985" "NA06991"
  &gt; g[-remove,]
  </code></pre>
  
  <blockquote>
    <p>Error in -remove : invalid argument to unary operator</p>
  </blockquote>
  
  <p>Is there a simple way to do what I want to do here (remove the ID's referenced in the vector 'remove' from matrix <strong>g</strong>?</p>
  
  <p><strong>Note:</strong> this is just a model for what I actually want to do, please don't say just do <code>g[-(1:2), ]</code>, I need to be able to remove a whole bunch of rows that I have ID-d.</p>