Re: [R] Extract correlations from a matrix

2007-11-09 Thread Christoph Scherber
Dear John and the rest, Finally, it seems that now I have found a solution for the problem: options(width=200) #make window size bigger #create a test dataset (which is a correlation matrix) #with row and col names #extract from this matrix only those correlations #that fulfill a specific criter

Re: [R] Extract correlations from a matrix

2007-11-08 Thread Rolf Turner
On 9/11/2007, at 9:01 AM, Julian Burgos wrote: > Hey Christoph, > > It is not clear what do you want to "extract". > w[w>0.6] does give you the correlation values above 0.6. What is your > question? > > Julian > Perhaps he wants which(w>0.6,arr.ind=TRUE) It is

Re: [R] Extract correlations from a matrix

2007-11-08 Thread Julian Burgos
Hey Christoph, It is not clear what do you want to "extract". w[w>0.6] does give you the correlation values above 0.6. What is your question? Julian Christoph Scherber wrote: > Dear R users, > > suppose I have a matrix of observations for which I calculate all > pair-wise correlations: > >

Re: [R] Extract correlations from a matrix

2007-11-08 Thread John Kane
w[w>.6] seems to work for me. I cut down the size of the matrix for easier visual inspection. m=matrix(sample(1:20,replace=T),4,5) w=cor(m,use="pairwise.complete.obs") w w[w>.6] perhaps perferabely w[w>0.6 & w!=1] --- Christoph Scherber <[EMAIL PROTECTED]> wrote: > Dear R users, > > supp

Re: [R] Extract correlations from a matrix

2007-11-08 Thread Henrique Dallazuanna
If I understand what you want, you can use 'which' which(w>0.6, arr.ind=T) On 08/11/2007, Christoph Scherber <[EMAIL PROTECTED]> wrote: > > Dear R users, > > suppose I have a matrix of observations for which I calculate all > pair-wise correlations: > > m=matrix(sample(1:100,replace=T),10,10) >

[R] Extract correlations from a matrix

2007-11-08 Thread Christoph Scherber
Dear R users, suppose I have a matrix of observations for which I calculate all pair-wise correlations: m=matrix(sample(1:100,replace=T),10,10) w=cor(m,use="pairwise.complete.obs") How do I extract only those correlations that are >0.6? w[w>0.6] #obviously doesn´t work, and I can´t find a way