title: Rotate a Matrix in R by 90 degrees clockwise
body: <p>I have a matrix in R like this:</p>
  
  <pre><code>|1|2|3|
  |1|2|3|
  |1|2|3|
  </code></pre>
  
  <p>Is there an easy way to rotate the entire matrix by 90 degrees clockwise to get these results?</p>
  
  <pre><code>|1|1|1|
  |2|2|2|
  |3|3|3|
  </code></pre>
  
  <p>and again rotating 90 degrees:</p>
  
  <pre><code>|3|2|1|
  |3|2|1|
  |3|2|1|
  </code></pre>
  
  <p>?</p>