stat_sum(mapping = NULL, data = NULL, geom = "point",
position = "identity", ...)
aes
or aes_string
. Only needs to be set
at the layer level if you are overriding the plot defaults.# by overall proportion d + stat_sum(aes(group = 1)) d + stat_sum(aes(group = 1)) + scale_size(range = c(3, 10)) d + stat_sum(aes(group = 1)) + scale_size_area(max_size = 10)
# by cut d + stat_sum(aes(group = cut)) d + stat_sum(aes(group = cut, colour = cut))
# by clarity d + stat_sum(aes(group = clarity)) d + stat_sum(aes(group = clarity, colour = cut))
# Instead of proportions, can also use sums d + stat_sum(aes(size = ..n..))
# Can also weight by another variable d + stat_sum(aes(group = 1, weight = price)) d + stat_sum(aes(group = 1, weight = price, size = ..n..))
# Or using qplot qplot(cut, clarity, data = diamonds) qplot(cut, clarity, data = diamonds, stat = "sum", group = 1)
ggfluctuation
for a fluctuation diagram,