Skip to content
Prev 295087 / 398506 Next

removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

On Sun, May 20, 2012 at 10:52 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
and here is a minor variation which is slightly shorter:

ix <- complete.cases(replace(M, upper.tri(M), 0))
M[ix, ix]