I have a dataframe with Column A containing values:
**Channel**
Direct
Paid social
Organic social
What I want to do: Create a new column called groupedChannel where str_detect searches for string in Column A to add a value in groupedChannel.
Condition:
IF row in Column A matches regex "direct" THEN Column B value = "Direct" ELSE
IF row in Column B matches regex "social" THEN Column B value = "Social"
AFAIK, str_detect will return only TRUE/FALSE. How can I use the TRUE/FALSE to assign a value in column B?