如题
data<-read.csv()#读入矩阵表达数据,row为gene names ,col为表达值
Quantile<-function(x){
ifelse(x>quantile(x,.75),"Q1",ifelse(x>quantile(x,.5),"Q2",ifelse(x>quantile(x,.25),"Q3","Q4")))
}#设置函数,四分位分组
Median<-function(x){
ifelse(x>median(x),"High","Low")
}#设置函数,中位数分组
new_quantile<-apply(data, 2, Quantile)
new_median<-apply(data, 2, Median)
自由发挥自由扩散