R: finding indices of columns in a data.frame
<pre><code>m &lt;- lm(Sepal.Length ~ Sepal.Width + Petal.Width, data = iris)
beta = dfbetas(m)
&gt; head(beta)
    (Intercept)   Sepal.Width   Petal.Width
1 -0.0018633253  0.0054762565 -0.0096031648
2  0.0094916858 -0.0062007468 -0.0137816086
3 -0.0221770886  0.0069280848  0.0540485812
4 -0.0408776612  0.0219247324  0.0731671391
5  0.0071436202 -0.0134636336  0.0150509697
6  0.0006264958 -0.0007979264  0.0001755277


apply(data.frame(beta), 2, function(x) which(abs(x) &lt; 0.1632993))
</code></pre>

<p>I have a matrix named <code>beta</code> that contains 3 columns. After converting it to type <code>data.frame</code>, I wanted to find the indices using the <code>which</code> function of observations whose absolute values are &lt; 0.1632993. Essentially I want a list of indices for each column. But my apply function doesn't seem to do what I wanted it to do. </p>