title: how to put non similar strings of a row in one element and count them
body: <p>I have a data like this with many blank spaces </p>
  
  <pre><code>df&lt;- structure(list(V1 = structure(c(3L, 1L, 2L, 1L), .Label = c("", 
  "P42356", "Q9NZT1"), class = "factor"), V2 = structure(c(1L, 
  1L, 1L, 2L), .Label = c("", "P63241,Q6IS14"), class = "factor"), 
      V3 = structure(c(3L, 1L, 2L, 1L), .Label = c("", "P42356,Q8N8J0,A4QPH2", 
      "Q13835"), class = "factor"), V4 = structure(c(1L, 1L, 1L, 
      2L), .Label = c("", "P63241"), class = "factor"), V5 = structure(c(3L, 
      1L, 1L, 2L), .Label = c("", "P63241", "Q13835"), class = "factor")), .Names = c("V1", 
  "V2", "V3", "V4", "V5"), class = "data.frame", row.names = c(NA, 
  -4L))
  
  
  &gt; df
  #      V1            V2                   V3     V4     V5
  #1 Q9NZT1                             Q13835        Q13835
  #2                                                        
  #3 P42356               P42356,Q8N8J0,A4QPH2              
  #4             P63241,Q6IS14                   P63241   P63241
  </code></pre>
  
  <p>I want to add two columns in this <strong>df</strong> lets say V6 and V7
  the first one, keep only one string among all similar strings in one row and count all string in each row </p>
  
  <p>example output is like this </p>
  
  <pre><code>  V6                       V7
  Q9NZT1,Q13835              2
        -                    0
  P42356,Q8N8J0,A4QPH2       3
  P63241,Q6IS14              2
  </code></pre>