title: R combine cell content if condition true
body: <p>I want to combine the content of two cells if several conditions are true. </p>
  
  <p>I have the follwoing dataframe: </p>
  
  <pre><code>df &lt;- data.frame(page = c("a1","a1","a2","a2","a3"),
                   keyword = c("a,b,c", "a,b,c,d", "d,e,f","g","a"))
  </code></pre>
  
  <p>The conditions in pseudo code: </p>
  
  <pre><code>if some cells of column page are equal (e.g. a1 and a2 appear two times)
  then combine the content of column keyword and delete duplicate content. 
  </code></pre>
  
  <p>This means in the end I need a dataframe, which looks like this: </p>
  
  <pre><code>page  keyword
    a1  a,b,c,d
    a2  d,e,f,g 
    a3  a
  </code></pre>
  
  <p>I already tried different approaches but didnt receive the correct result. Does anybody has an idea?</p>