我想用两个单词分割一个字符串:
s <- "PCB153 treated HepG2 cells at T18" strsplit(s,split = <treated><at>)
我该怎么写而不是<>?
我会得到:
"PCB153" "HepG2 cells" "T18"
解决方法
strsplit(s,split="treated|at") #[[1]] #[1] "PCB153 " " HepG2 cells " " T18"