str_detect替换

作者: ChrisNing | 来源:发表于2019-07-04 08:10 被阅读0次
x <- pd$title
length(x)
for(i in 1:length(x)){
  gplist[i]<- if(str_detect(x[i],"Day 7") == T) {"ICUAW"} 
           else if (str_detect(x[i],"Day7") == T) {"ICUAW"}
           else if (str_detect(x[i],"Month 6") == T) {"M6"}
           else {"Healthy Control"}
}
gplist

相关文章

  • str_detect替换

  • stringr包中str_detect()

    首先看下str_detect()中的参数 str_detect(string,pattern,negate=FAL...

  • 2021-03-06

    pd$OScensor<-ifelse(str_detect(pd$OScensor,"DEAD"),1,0) 这...

  • stringr::str_detect 忽略大小写

    stringr::str_detect默认是区分大小写的,但有时想要忽略,怎么办? 或 from stringr ...

  • R for data Science(十)

    承接上次继续学习stringr这个包,今天学习这几个函数str_detect, str_subset,str_ex...

  • R字符串操作(二)

    前文学习了R基础的字符串操作函数,这次来学习 stringr 提供的函数。 检测子字符串 str_detect(s...

  • 2018-06-09

    替换 春天替换冬天 秋天替换夏天 冬天替换秋天 手机替换手表 歌曲替换戏曲 小品替换响声 小孩替换老人 单身替换命运

  • Linux之vim操作

    简单替换 替换的文本中不包含/:%s需要替换的文本替换的文本 替换的文本中包含/:%s需要替换的文本替换的文本RG...

  • 查找、替换与定位

    一、查找与替换 1、替换 基本替换 规定格式替换 按颜色替换 规定条件替换 规定替换两个字,要单元格匹配 2、按格...

  • @weakify(self)解析

    ①通过 替换结果为: ②根据 替换结果为: ③通过 替换结果为: ④通过 替换结果为: ⑤通过 替换结果为: ⑥根...

网友评论

    本文标题:str_detect替换

    本文链接:https://www.haomeiwen.com/subject/xubkhctx.html