[R] subscripting a one column matrix drops dimension

moacir at supagro.inra.fr moacir at supagro.inra.fr
Tue Oct 21 21:32:24 CEST 2008

Hi all,

Well, I just sent a help msg to the list with this subject,
but I think I figured out a way to solve my problem
(although I still have no clue if the behavior I described
is correct).

What I did was to replace occurrences of (for example)

                cov(x[sub, ])


                cov(matrix(x[sub, ], ncol=ncol(x))

It works.

I updated my source version of the cclust package. It
may be of interest to somebody else, but I don't know
how to submit to the package mantainer.

Thank you.

Moacir Pedroso Jr.
Embrapa - Empresa Brasileira de Pesquisa Agropecuária
(on leave at INRA - Instutute National de la Recherche Agronomique)

More information about the R-help mailing list