Just as an update on this problem:
I have managed to get the variance for the selected columns
Now all I need is the covariance between these 2 selections -
the two target columns are and the aim is that a new column contain a
covariance value between these on each row:
maindata[,c(174:213)]
Hi Rob,
Here is one approach:
## define a function that does the calculations
## (the covariance of two vectors divided by the square root of
## the products of their variances is just a correlation)
rF - function(x, a, b) cor(x[a], x[b], use = complete.obs)
set.seed(1)
bigdata -
???
-Original Message-
From: Joshua Wiley
Sent: Tuesday, November 15, 2011 7:14 PM
To: robgriffin247
Cc: r-help@r-project.org
Subject: Re: [R] correlations between columns for each row
Hi Rob,
Here is one approach:
## define a function that does the calculations
## (the covariance
: Tuesday, November 15, 2011 7:14 PM
To: robgriffin247
Cc: r-help@r-project.org
Subject: Re: [R] correlations between columns for each row
Hi Rob,
Here is one approach:
## define a function that does the calculations
## (the covariance of two vectors divided by the square root
very much both of you!
Rob
-Original Message-
From: R. Michael Weylandt michael.weyla...@gmail.com
Sent: Tuesday, November 15, 2011 9:28 PM
To: Rob Griffin
Cc: Joshua Wiley ; r-help@r-project.org
Subject: Re: [R] correlations between columns for each row
Is the whole thing a data frame
Hello fellow R-users,
Iâve been mulling this problem over for some time now and have decided it is
something I have to deal with but canât, so here goes:
I have a dataset (called maindata, it is 271 columns *13890 rows so I wont post
the entire thing here, Iâll just explain the situation!)
6 matches
Mail list logo