討論串[問題] 用一行code str_detect 判斷多個string元素
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
迴圈在資料大一點也會慢. 會建議下面做法:. library(stringr). library(pipeR). strs <- sample(letters[1:4], 500, TRUE) %>>%. (str_c(.[1:125], .[126:250], .[251:375], .[376:
(還有428個字)
內容預覽:
我上網看到有人討論. 當要判斷的strin 為多個可以用. string =c("a","b"). str_detect(data, paste(string, collapse = '|')). 用| 去判斷字串中有 a or b的出現有無. 我後來想如果我要取「同時」要有a 與b 本以為只要把|
(還有21個字)
首頁
上一頁
1
下一頁
尾頁