title: Inverse of matrix in R
body: <p>I was wondering what is your recommended way to compute the inverse of a matrix?</p>
  
  <p>The ways I found seem not satisfactory. For example, </p>
  
  <pre><code>&gt; c=rbind(c(1, -1/4), c(-1/4, 1))  
  &gt; c  
        [,1]  [,2]  
  [1,]  1.00 -0.25  
  [2,] -0.25  1.00  
  &gt; inv(c)  
  Error: could not find function "inv"  
  &gt; solve(c)    
            [,1]      [,2]  
  [1,] 1.0666667 0.2666667  
  [2,] 0.2666667 1.0666667  
  &gt; solve(c)*c  
              [,1]        [,2]  
  [1,]  1.06666667 -0.06666667  
  [2,] -0.06666667  1.06666667  
  &gt; qr.solve(c)*c  
              [,1]        [,2]  
  [1,]  1.06666667 -0.06666667  
  [2,] -0.06666667  1.06666667  
  </code></pre>
  
  <p>Thanks!</p>