I need to extract all the text before a sign, in this case a dash. I have data like these:
text1 <- "Médicos-Otros"
text2 <- "Disturbio-Escándalo"
text3 <- "Accidente-Choque"
The problem is that the words that i am trying to extract don't have the same lenght so i can't try some of these
extract <- substring(text1, 1, n)
desired results are:
extract1 <- "Médicos"
extract2 <- "Disturbio"
extract3 <- "Accidente"