title: Create a column and assign values based on string variable in R
body: <p>This is the sample data frame:</p>
  
  <pre><code> keyword &lt;- c("advertising plan","advertising budget",
           "marketing plan",
           "marketing budget",
           "hr plan",
           "hr budget",
           "operation plan",
           "operation budget")
   indicator &lt;- c(1,0,1,0,0,1,1,1)
   df &lt;- data_frame(keyword,indicator)
  </code></pre>
  
  <p>I need to create a new column called "Type", and assign "Type A" to the cells if the keyword contains "advertising" or "marketing" while assign "Type B" to the cells if the keyword contains "hr" or "operation".</p>