title: Remove a list of rownames from matrix in R
body: <p>I have a matrix of entries:</p>
  
  <pre><code>testMat &lt;- matrix(1:30, nrow = 10)
  rownames(testMat) &lt;- letters[1:10]
  </code></pre>
  
  <p>... and a list of rownames:</p>
  
  <pre><code>rem &lt;- c("d", "e", "f", "i")
  </code></pre>
  
  <p>Extracting a matrix containing only the rows with names provided in the list 'rem' is easy:</p>
  
  <pre><code>testMat[rem,]
  </code></pre>
  
  <p>Following this logic I would like to <em>remove</em> the rows with names provided in the list 'rem' from the matrix. But</p>
  
  <pre><code>testMat[-rem,]
  </code></pre>
  
  <p>failes with <code>Error in -rem : invalid argument to unary operator</code>.
  Why does that not work?</p>