Search
Question: How to take mean from specific column
0
gravatar for kritikamish99
5 months 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 5 months ago by Gordon Smyth33k • written 5 months ago by kritikamish9910
0
gravatar for Gordon Smyth
5 months ago by
Gordon Smyth33k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth33k 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 5 months ago • written 5 months ago by Gordon Smyth33k
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: 168 users visited in the last hour