aphalo / ggpp

Grammar of graphics extensions to 'ggplot2'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support fraction and percent of observations in `stat_quadrant_counts()` and `stat_group_counts()`.

aphalo opened this issue · comments

ref: Robin's question

Instead of only supporting counts, support in addition fraction of observations and percent of observations.

To implement this in stat_group_counts() I need to replace the current use of a compute group function by a compute panel function adapted from that in stat_quadrant_counts() because to compute fractions of total we need access to all data when generating the labels for separate groups. At the same time one could possibly automate the support for factors mapped to x or y.

This is now implemented in stat_quadrant_counts() and will be useful. Unit tests have still to be added.

Now implemented, including unit tests.