matrix to list
On Wed, Sep 17, 2008 at 8:52 PM, Pinder, Adrian
<Adrian.Pinder at dec.wa.gov.au> wrote:
Hi, can someone please tell me how to convert a square matrix to a list in R?
i.e. I want to convert from:
a b c
a 1 1 1
b 2 2 2
c 3 3 3
to:
a a 1
a b 1
a c 1
b a 2
b b 2
b c 2
c a 3
c b 3
c c 3
Try melt from the reshape package. Hadley