title: Square a matrix in R
body: <p>I've searched and am surprised not to find an answer to the following fairly basic question:</p>
  
  <p>How do you square a matrix in R?  That is to say, for a square matrix $A$ how do I compute $A^{2}$?  Of course I could matrix product it with itself, but if the matrix I want to square has a very long expression, this seems undesirable, and worse if I were to want a higher power.  </p>
  
  <p>I heard one person mention the <code>expm</code> package while talking about his problem and I suppose I could try this, but it mentioned a bug that I'm not certain has been fixed.  It's also surprising you'd need to import a package to do this pretty basic matrix operation, but maybe that's just how it is.</p>