关于解决问题:
Warning message:
In tumor_normal$group <- sapply(tumor_normal, function(x) { :
把公式左手强迫变成串列
原因是,首先将矩阵变成数据框,变成数据框之后即可增加一个新列(group)
tumor_normal<-BRCA_FPKM_final[“FOXN1”,] %>%
t() %>%
as.data.frame()
tumor_normal$group<-sapply(tumor_normal,function(x){ifelse(substr(rownames(tumor_normal),14,15)<=10,“tumor”,“normal”)}) %>%
as.factor()