group_list2<-ifelse(pd2$characteristics_ch1=="Tissue: Liver Non-Tumor Tissue","Non_Tumor_HCC",+ ifelse(pd2$characteristics_ch1=="Tissue: Liver Tumor Tissue","Tumor_HCC","Healthy")),这个是老师给的,它把一列字符串分为3类了
group_list2<-ifelse(pd2$characteristics_ch1=="Tissue:Liver Non-Tumor Tissue","Non-Tumor",ifelse(pd2$characteristics_ch1=="Tissue:Liver Tumor Tissue","Tumor","Healthy")),这个是我自己理解着写的,最后的效果是一列中所有字符串全部被归为healthy,没有达到分类的效果
有没有大佬或者好心人帮忙看看这个是为什么呀?我用?查了ifelse,这个函数后面是(file,yes,no),分两类的用法我好像会了,但分三类真的看不懂
group_list2<-ifelse(pd2$characteristics_ch1=="Tissue:Liver Non-Tumor Tissue","Non-Tumor",ifelse(pd2$characteristics_ch1=="Tissue:Liver Tumor Tissue","Tumor","Healthy")),这个是我自己理解着写的,最后的效果是一列中所有字符串全部被归为healthy,没有达到分类的效果
有没有大佬或者好心人帮忙看看这个是为什么呀?我用?查了ifelse,这个函数后面是(file,yes,no),分两类的用法我好像会了,但分三类真的看不懂