Hi The cor function in the stats package calculates the correlation between columns of data, does anyone know if it is at all possible to calculate the correlation between rows instead ? Or is there an appropriate package or function that is more appropriate I'd like to calculate spearman & pearson correlations between rows. Many thanks Jason -- -------------------------------- Jason Skelton Pathogen Microarrays Wellcome Trust Sanger Institute Hinxton Cambridge CB10 1SA Tel +44(0)1223 834244 Ext 7123 Fax +44(0)1223 494919
Hi cor(t(matrix)) t=Transpose matrix Eryk *********** REPLY SEPARATOR *********** On 5/27/2004 at 11:34 AM Jason Skelton wrote:>Hi > >The cor function in the stats package calculates the correlation between >columns of data, does anyone know if it is at all possible to calculate >the correlation between rows instead ? >Or is there an appropriate package or function that is more appropriate >I'd like to calculate spearman & pearson correlations between rows. > >Many thanks > >Jason > > > >-- >-------------------------------- >Jason Skelton >Pathogen Microarrays >Wellcome Trust Sanger Institute >Hinxton >Cambridge >CB10 1SA > >Tel +44(0)1223 834244 Ext 7123 >Fax +44(0)1223 494919 > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlDipl. bio-chem. Eryk Witold Wolski @ MPI-Moleculare Genetic Ihnestrasse 63-73 14195 Berlin 'v' tel: 0049-30-83875219 / \ mail: wolski at molgen.mpg.de ---W-W---- http://www.molgen.mpg.de/~wolski
Jason, If you have a matrix m, you can take cor(t(m)) Where t is the transpose operator. Sean On 5/27/04 6:34 AM, "Jason Skelton" <jps at sanger.ac.uk> wrote:> > Hi > > The cor function in the stats package calculates the correlation between > columns of data, does anyone know if it is at all possible to calculate > the correlation between rows instead ? > Or is there an appropriate package or function that is more appropriate > I'd like to calculate spearman & pearson correlations between rows. > > Many thanks > > Jason > >