I have a dataset (with 100k rows) with strings that contain almost similar names, but I need to separate the names.
fertilizer_name<-c('Urea (inorganic)', 'solid manure (organic)')
df1<-data.frame(fertilizer_name)
I have tried the grep function, but since organic is contained in the Inorganic, then it filters both organic and inorganic as follows
df1 %>% filter(grepl('Organic', fertilizer_name))

Just exclude the
inorganic