How to take mean from specific column
1
0
Entering edit mode
@kritikamish99-9648
Last seen 5.8 years ago
India

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

Mean R • 767 views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

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 COMMENT

Login before adding your answer.

Traffic: 464 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6