將原先包含_N_T_hisens的字符替換成-T:
segment$Sample <- gsub("_N_T_hisens", "-T", segment$segName, fixed = TRUE)
另外一種方法,通過調用包stringr中的str_remove函數實現:
require(stringr)
seg$segName <- paste(str_remove(seg$segName,"_N_T_hisens"),"-T",sep = "")
將原先包含_N_T_hisens的字符替換成-T:
segment$Sample <- gsub("_N_T_hisens", "-T", segment$segName, fixed = TRUE)
另外一種方法,通過調用包stringr中的str_remove函數實現:
require(stringr)
seg$segName <- paste(str_remove(seg$segName,"_N_T_hisens"),"-T",sep = "")
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。