Description Usage Format Examples
Applies a function to a specified grouping variable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | stat_summarise(
mapping = NULL,
data = NULL,
geom = "bar",
position = "identity",
...,
fun = NULL,
fun.args = list(),
show.legend = NA,
inherit.aes = TRUE
)
stat_summarize(
mapping = NULL,
data = NULL,
geom = "bar",
position = "identity",
...,
fun = NULL,
fun.args = list(),
show.legend = NA,
inherit.aes = TRUE
)
|
An object of class Summarise
(inherits from Stat
, ggproto
, gg
) of length 5.
An object of class Summarize
(inherits from Stat
, ggproto
, gg
) of length 5.
1 2 3 4 5 6 7 8 9 10 11 12 | #library(tidyr)
i <- gather(iris,"key","value",-Species)
ggplot(i, aes(Species, fill = key, domain = value)) +
geom_bar(aes(y = after_stat(summarise)), stat = "summarise") +
stat_summarise(aes(y = after_stat(summarise),
label = after_stat(summarise)),
position = position_stack(vjust = .5), geom = "text")
ggplot(i, aes(key, fill = Species, domain = value)) +
geom_bar(aes(y = after_stat(summarise)), stat = "summarise") +
stat_summarise(aes(y = after_stat(summarise),
label = after_stat(summarise)),
position = position_stack(vjust = .5), geom = "text")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.