更新时间:2023-01-31 12:36:45
使用你的数据,你先写一个 min max 函数:
Using your data, you write a min max function first:
minmax = function(x){ (x-min(x))/(max(x)-min(x))}
然后遍历列:
norm = data.frame(lapply(dat1[,1:3],function(i) minmax(i/dat1$samples)))
它看起来像这样,我希望它是正确的:
And it looks like this, I hope it's correct:
gene1 gene2 gene3
1 0.03385417 0.2458333 1.00000000
2 0.61970339 1.0000000 0.01326455
3 0.00000000 0.0000000 0.09565217
4 1.00000000 0.2269231 0.00000000