title: Filter the data by joining 2 columns (strings containing comma) in R
body: <p>I have a df</p>
  
  <pre><code>ID &lt;- c('DX154','DX154','DX155','DX155','DX156','DX157','DX158','DX159') 
  Country &lt;- c('US','US','US','US')
  Level &lt;- c('Level_1A','Level_1A','Level_1B','Level_1B','Level_1A','Level_1B','Level_1B','Level_1A')
  Type_A &lt;- c('Iphone','Iphone','Android','Android','aaa','bbb','ccc','ddd')
  Type_B &lt;- c("Iphone,Ipad,Ipod,Mac","Gmail,Android,Drive,Maps","Iphone,Ipad,Ipod,Mac","Gmail,Android,Drive,Maps","ALL","ALL","ALL","ALL")
  df &lt;- data.frame(ID ,Country ,Level ,Type_A,Type_B)
  </code></pre>
  
  <p>df</p>
  
  <pre><code>           ID Country    Level  Type_A                   Type_B
  1 DX154      US Level_1A  Iphone     Iphone,Ipad,Ipod,Mac
  2 DX154      US Level_1A  Iphone Gmail,Android,Drive,Maps
  3 DX155      US Level_1B Android     Iphone,Ipad,Ipod,Mac
  4 DX155      US Level_1B Android Gmail,Android,Drive,Maps
  5 DX156      US Level_1A     aaa                      ALL
  6 DX157      US Level_1B     bbb                      ALL
  7 DX158      US Level_1B     ccc                      ALL
  8 DX159      US Level_1A     ddd                      ALL
  </code></pre>
  
  <p>I am trying to filer this data frame by joining the column Type_A, Type_B but not knowing how to parse the comma. Could someone please help me with this. </p>
  
  <p>My Desired output is </p>
  
  <pre><code>        ID Country    Level  Type_A                   Type_B
  1 DX154      US Level_1A  Iphone     Iphone,Ipad,Ipod,Mac
  2 DX155      US Level_1B Android Gmail,Android,Drive,Maps
  3 DX156      US Level_1A     aaa                      ALL
  4 DX157      US Level_1B     bbb                      ALL
  5 DX158      US Level_1B     ccc                      ALL
  6 DX159      US Level_1A     ddd                      ALL
  </code></pre>