title: Count by factor in ggplot2 chart
body: <p>Given the following ggplot2 chart:</p>
  
  <pre><code>ggplot(my_data, aes(colour=my_factor) +   
                  geom_point(aes(x=prior, y=current)) +   
                  facet_grid(gender ~ age)
  </code></pre>
  
  <p>I would like to make the size of the points be proportional to the count of my_factor for that prior/current combination.</p>
  
  <pre><code>ggplot(my_data, aes(colour=my_factor, 
                  size=&lt;something-here&gt;(my_factor)) +   
                  geom_point(aes(x=prior, y=current)) + 
                  facet_grid(gender ~ age)
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>== Edit ==</p>
  
  <p>Here's a very trivial example based on mpg dataset. Let's define "great_hwy" as hwy > 35, and "great_cty" as cty > 25:</p>
  
  <pre><code>mpg$great_hwy[mpg$hwy &gt; 35]  &lt;-1
  mpg$great_hwy[mpg$hwy &lt;= 35] &lt;-0
  mpg$great_hwy &lt;- factor(mpg$great_hwy)
  
  mpg$great_cty[mpg$cty &gt; 25]  &lt;- 1
  mpg$great_cty[mpg$cty &lt;= 25] &lt;- 0
  mpg$great_cty &lt;- factor(mpg$great_cty)
  </code></pre>
  
  <p>If we plot great_hwy vs. great_cty, it won't tell us much:</p>
  
  <pre><code>ggplot(mpg) + geom_point(aes(x=great_cty, y=great_hwy))
  </code></pre>
  
  <p>How could I make the data points bigger in size depending on the number of x/y points? Hope this clears it up, but let me know otherwise.</p>