I would like to drop the characters obovate at second position
df <- data.frame(x = c("Antidesma obovate",
"Ardisia obovate", "Knema obovate", "Lauraceae obovate"))
My desired output
Antidesma
Ardisia
Knema
Lauraceae
I found one topic kind of answering my quesion (Drop characters from string based on position)
but here I need to call specific character that I want to remove.
So far, I only know using str_detect to change the name right away e.g.
df %>% mutate(x= ifelse(str_detect(x, "Antidesma obovate"), "Antidesma ", x)) %>%
Any suggestions for me, please?