Inverse of column values in R
<p>I have a matrix called <code>mydf</code>. How do I get the inverse of columns A and C as shown in result?</p>

<p>mydf</p>

<pre><code>A  B  C
2  2  2 
1  3  2
</code></pre>

<p>result</p>

<pre><code>A    B   C
0.5  2   0.5
1    3   0.5
</code></pre>