I would like to split a string by two words:
s <- "PCB153 treated HepG2 cells at T18"
strsplit(s, split = <treated><at>)
What should I write instead of <>?
I would get:
"PCB153" "HepG2 cells" "T18"
strsplit(s, split="treated|at")
#[[1]]
#[1] "PCB153 " " HepG2 cells " " T18"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With