On Wed, Sep 17, 2008 at 8:52 PM, Pinder, Adrian
<[EMAIL PROTECTED]> 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

-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to