title: How can you aggregate a single column based all the other columns?
body: <p>I have a large number of CSV files that contain survey data. As a result I know that there is a good deal of duplicated data. Thus, I want to summarize the data by finding the frequency of unique responses. Typically I do this by inserting a frequency column with a value of one and then summing it. Like so:</p>
  
  <pre><code>data = aggregate(data$Freq, by = list(ONE = data$ONE, TWO = data$TWO, THREE  = data$THREE), FUN = sum)
  </code></pre>
  
  <p>In this case that approach is not feasible since the column names are not consistent and are variable in number. Sample data looks like what the following generates:</p>
  
  <pre><code>data = data.frame(
     ONE   = sample(1:2, 40, TRUE), 
     TWO   = sample(1:2, 40, TRUE),
     THREE = sample(1:5, 40, TRUE)); 
  data$Freq = 1
  </code></pre>
  
  <p>How can I preserve the unique values and find the count of their appearance?</p>