Dear Dulce
   Thank you for your quickly response.  I added the rownames and columnames for the dataframe.
As you can see,the melt() function in "reshape" packaged provide the results exactly what I needed. 
Thank you very much!
Best Regards!
 
yours Jinlong

library(reshape)
x <- cbind(rnorm(4), rnorm(4), rnorm(4), rnorm(4))
names<-c("A","B","C","D")
colnames(x)<-names
rownames(x)<-names
x
y <- cor(x)
melt(y)


> Hi Jinlong, 

>  

> Try the function melt() in the "reshape" package (http://had.co.nz/reshape/  

> ). I strongly encourage you to read the paper with the description of   

> the package, which is also available in the same link. 

>  

> Regards, 

>  

> Dulce 

>  

>  

> El 24/07/2009, a las 0:49, Zhang Jinlong escribi? 

>  

> > Dear lists 

> >  Suppose I have an correlation matrix of four places named   

> > "A","B","C"and"D", as below: 

> >    A     B      C    D 

> > A   0    0.5   0.2   0.8 

> > B  0.5   0     0.6   0.4 

> > C  0.2   0.6   0      0.4 

> > D  0.8   0.4   0.4    0 

> > Is there a function that allows me to generate the paired list like   

> > this? 

> > A B 0.5 

> > A C 0.2 

> > A D 0.8 

> > B C 0.6 

> > B D 0.4 

> > C D 0.4 

> > Could you help me if you know a method. Any suggestions will be   

> > appreciated. 

> > Thanks 

> > Jinlong 

> > 

> > 

> > Jin-Long ZHANG 

> > Ph.D. Candidate 

> > Institute of Botany 

> > Chinese Academy of Sciences 

> > Beijing 100093 

> > E-mail: zhangjl@ibcas.ac.cn 

> > 

> > 

> >  [[alternative HTML version deleted]] 

> > 

> > _______________________________________________ 

> > R-sig-ecology mailing list 

> > R-sig-ecology@r-project.org 

> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology 

>  

> Maria Dulce Subida 

>  

>    *   *    *    *    *    * 

> new e-mail address: mdsubida@icman.csic.es 

> *   *    *    *    *    *    * 

> Instituto de Ciencias Marinas de Andalucía (ICMAN) 

> Consejo Superior de Investigaciones Científicas (CSIC) 

> Campus Universitário Río San Pedro 

> 11510 Puerto Real - Cádiz. España. 

>  

> www.icman.csic.es               0034 956832612 ext. 316 

>  

>    *   *    *    *    *    * 

> *   *    *    *    *    *    * 

>  

> 

Jin-Long ZHANG 
Ph.D. Candidate
Institute of Botany
Chinese Academy of Sciences
Beijing 100093
E-mail: zhangjl@ibcas.ac.cn 


	[[alternative HTML version deleted]]

