Answers for "extract first element before a character stringr"

R
0

extract first element before a character stringr

library(stringr)

df1 <- read.table(text = "ABC|DEF|GHI, ABCD|EFG|HIJK,  ABCDE|FGHI|JKL,  
                         DEF|GHIJ|KLM, GHI|JKLM|NO|PQRS, BCDE|FGHI|JKL")
#extract 1st word before |
word(df1$V1,1,sep = "\\|")
Posted by: Guest on March-17-2021

Code answers related to "extract first element before a character stringr"

Browse Popular Code Answers by Language