Closed MichaelJMahometa closed 5 years ago
This is a feature/limitation of ggplot2, and I don't know of any easy way to get the behavior that I think you want unless you precalculate the counts or percentages you want and then create the plot. df_stats()
makes this relatively easy -- but not as easy as you would like.
See #118 for more information.
Thanks for this (and the reference link (don't know why I didn't see it with the search)). Thanks also for this work with ggformula.
When running:
The resulting percentages are within the facet groups (sex)--matching the margins total to 1. When using the same formulation in
gf_percents()
:The resulting percentages in the graph are not matching the
tally()
output--they are not conditional percentages within the facet panel---they are full table percentages.This seems incongruous with the desire of mosaic and ggformula working synonymously with the formula definitions.
If there is a way for
gf_percents()
to match thetally()
with an option, I'll take it...as I'd like to use both---and hopefully have them match---this semester.Thanks, Michael