Search
Question: How to take mean from specific column
0
gravatar for kritikamish99
17 days ago by
India
kritikamish9910 wrote:

Hi

I have column of gene expression  of 208 (104X2) samples. I want to take mean of all replicates using R loop Can any one suggest me

 

w x y a b e

5 1 1 2 4 1

6 2 2 5 3 6

7 3 3 8 9 3

8 4 6 9 1 3

so for example i have have w x y a b e columns i want to take avaerage of w and x, y and a , b and e and Print the average value into another data frame names as w_x y_a b_e

ADD COMMENTlink modified 17 days ago by Gordon Smyth32k • written 17 days ago by kritikamish9910
0
gravatar for Gordon Smyth
17 days ago by
Gordon Smyth32k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth32k wrote:

The avearrays() function in the limma package does what you want. For example, if the replicates you want to average are side by side, then

ID <- rep(1:104, each=2)
ReducedExprMatrix <- avearrays(ExprMatrix, ID)

In general, columns with the same ID will be averaged.

ADD COMMENTlink modified 17 days ago • written 17 days ago by Gordon Smyth32k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 332 users visited in the last hour