title: Check if all rows are the same in a matrix
body: <p>I'm looking to see if <code>sample(..., replace=T)</code> results in sampling the same row <code>n</code> times. I see the <code>duplicated</code> function checks if elements are repeated by returning a logical vector for each index, but I need to see if one element is repeated <code>n</code> times (single boolean value). What's the best way to go about this?</p>
  
  <p>Here's just an example. Some function on this matrix should return <code>TRUE</code></p>
  
  <pre><code>t(matrix(c(rep(c(rep(4,1),rep(5,1)),8)),nrow=2,ncol=8))
       [,1] [,2]
  [1,]    4    5
  [2,]    4    5
  [3,]    4    5
  [4,]    4    5
  [5,]    4    5
  [6,]    4    5
  [7,]    4    5
  [8,]    4    5
  </code></pre>