Re: [R] Please help -- Converting a 2D matrix to 3 columns for graphical representation

2011-01-28 Thread Tal Galili
There you go: rdata = replicate(100, rnorm(15)) #construct a 2D matrix c1 = cor(rdata) require(reshape) m_c1 - melt(as.matrix(c1)) head(m_c1) Cheers, Tal Contact Details:--- Contact me: tal.gal...@gmail.com |

[R] Please help -- Converting a 2D matrix to 3 columns for graphical representation

2011-01-27 Thread kparamas
Hi, I am trying to convert a 2D correlation matrix to 3 columns for graphical representation: rdata = replicate(100, rnorm(15)) #construct a 2D matrix c1 = cor(rdata) #outputs a correlation matrix Now I want to convert the 2D c1 to (row#, col#, correlation) 1 1 cor1 1 2 cor2 1 3 cor3 ... 2 1