我是 R 和编码的新手,所以这可能是一个非常明显的答案!
我有一个数据集,其中包含针对数千个基因探针的四个水蚤复制品的 log2 值,对应于各种基因(如图所示)。但是,对于每个重复,我想获得每个基因的平均表达。有没有办法我可以做到这一点?
这是我的数据框的顶部:
s_MC13_B1_Cd.Ni s_MC13_B2_Cd.Ni s_MC13_B3_Cd.Ni s_MC13_B4_Cd.Ni
[1,] "3.32737034165695" "3.30082063716602" "3.35288781669471"
"3.28130201442409"
[2,] "2.99677521546021" "2.97525202994054" "3.01357652548303"
"2.98091704146676"
[3,] "3.22057255739705" "3.24001410852619" "3.19806113996704"
"3.17850023932788"
[4,] "3.17934205285383" "3.22237873890637" "3.20299332433795"
"3.19533925098426"
[5,] "3.20285957796094" "3.22659173854477" "3.22878128735342"
"3.21307289097597"
[6,] "3.16945922109561" "3.1672329312015" "3.17366131274743"
"3.18792397254863"
[1,] "GENE:JGI_V11_100009"
[2,] "GENE:JGI_V11_100009"
[3,] "GENE:JGI_V11_100036"
[4,] "GENE:JGI_V11_100036"
[5,] "GENE:JGI_V11_100036"
[6,] "GENE:JGI_V11_100044"
基本上我想为每个基因(第 5 列)获取每列的平均值 - 例如,我想为每列获取前 2 行的平均值(GENE:JGI_V11_100009),并对第 5 列中的每个基因执行此操作