[問題] match找不到數值
這是一段來自於github上的一段程式碼
其中samples=c("A_r","A_ir","B_r","B_ir",...)
reps <- grep("_r|_ir",samples,value=TRUE) # get the replicates (ending with _r or _ir)
samps <- match(sub("_r|_ir","",reps),samples) # match against its sample (ie names w/o _r or _ir)
不過我照著執行後samps只會出現一堆NA
想問這是怎麼回事?
--
Sent from my Windows
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.122.136.81
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1530089084.A.717.html
→
06/27 18:15,
6年前
, 1F
06/27 18:15, 1F
→
06/28 11:20,
6年前
, 2F
06/28 11:20, 2F
原文上面寫的 我也覺得很奇怪
※ 編輯: k97231 (140.122.152.43), 07/02/2018 09:36:46
→
07/08 03:17,
6年前
, 3F
07/08 03:17, 3F
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章