Hello, I have a set of 12 individuals with thousands of variables measured. I understand that when I'm using the cor() function on my matrix I'm calculating the correlation between the different variables according to their values for the different individuals. What I'm willing to do is to calculate a correlation between the individuals and I have no clue how I can do that. Could you please help me ? Thanks, Emmanuelle -- Emmanuelle MORIN UMR 1136 INRA/Universit? de Lorraine F-54280 Champenoux Tel : + 33 3 83 39 41 33 http://mycor.nancy.inra.fr
Assuming your data is called BIG and has 12 rows and thousands of columns: cor(t(BIG)) ------------------------------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of emmanuelle morin Sent: Friday, February 5, 2016 8:07 AM To: r-help at r-project.org Subject: [R] pearson correlation matrix Hello, I have a set of 12 individuals with thousands of variables measured. I understand that when I'm using the cor() function on my matrix I'm calculating the correlation between the different variables according to their values for the different individuals. What I'm willing to do is to calculate a correlation between the individuals and I have no clue how I can do that. Could you please help me ? Thanks, Emmanuelle -- Emmanuelle MORIN UMR 1136 INRA/Universit? de Lorraine F-54280 Champenoux Tel : + 33 3 83 39 41 33 http://mycor.nancy.inra.fr ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Assuming your dataset is in a matrix you want to transpose it. So you can go t(mesdonnees) and then call cor on that. On 05/02/2016 14:06, emmanuelle morin wrote:> Hello, > > I have a set of 12 individuals with thousands of variables measured. > I understand that when I'm using the cor() function on my matrix I'm > calculating the correlation between the different variables according to > their values for the different individuals. > > What I'm willing to do is to calculate a correlation between the > individuals and I have no clue how I can do that. > Could you please help me ? > > Thanks, > > Emmanuelle >-- Michael http://www.dewey.myzen.co.uk/home.html
ok, it will still make sense ? Le 05/02/2016 15:31, Michael Dewey a ?crit :> Assuming your dataset is in a matrix you want to transpose it. So you > can go t(mesdonnees) and then call cor on that. > > On 05/02/2016 14:06, emmanuelle morin wrote: >> Hello, >> >> I have a set of 12 individuals with thousands of variables measured. >> I understand that when I'm using the cor() function on my matrix I'm >> calculating the correlation between the different variables according to >> their values for the different individuals. >> >> What I'm willing to do is to calculate a correlation between the >> individuals and I have no clue how I can do that. >> Could you please help me ? >> >> Thanks, >> >> Emmanuelle >> >-- Emmanuelle MORIN UMR 1136 INRA/Universit? de Lorraine F-54280 Champenoux Tel : + 33 3 83 39 41 33 http://mycor.nancy.inra.fr