I have a string and I need to match only 2 words like
increase/decrease and I need to skip all of the words. Then I will pass this
str_detect to split my dataframe.
The metabolism of Drug b can be decreased when combined with Drug a.
I can capture
decrease for the sample string
But the real dataframe does not contain any Drug a or Drug b. It contains the real name of the drug and the number of a word for the drug name can be varied from drug to drug! For example,
Cyclosporine Brexpiprazole, and
Ivabradine these are 2 drug names!
Then I will apply this pattern to my code like
demo %>% filter(str_detect(description,pattern)) -> new_df
Any kind of suggestion is appreciable.