View source: R/ggplot_functions.R
| stat_dots_and_bar | R Documentation |
Adds a dotplot, 95\
to a ggplot object. Almost identical to stat_errorbar, but
with the obvious additional geom_dotplot.
Right now, only uses default values for the error bars.
stat_dots_and_bar( ..., binaxis = "y", stackdir = "center", dotsize = 0.5, alpha = 0.2 ) geom_dots_and_bars( ..., binaxis = "y", stackdir = "center", dotsize = 0.5, alpha = 0.2 )
... |
Additional arguments for the |
binaxis |
Set by default to "y" |
stackdir |
Set by default to "center" |
dotsize |
Set by default to 0.5 |
alpha |
Set by default to 0.2 |
geom_dots_and_bars is the deprecated name for stat_dots_and_bar. I realized that
ggplot2 already had a geom_errorbar, which would be very
confusing for geom_dots_and_bars's sister function, geom_errorbars.
To keep the naming similarity, and because geom_dots_and_bars operated more
like a stat function (e.g., stat_summary) than a geom, it made
more sense to change its name.
A list of the stat_summary objects
stat_errorbar
df <- data.frame(
y<-rnorm(100),
x<-factor(c(rep("Label1",50), rep("Label2",50)))
)
ggplot(df, aes(x = x, y = y)) +
stat_dots_and_bar(color="red",fill="red") +
xlab("WHAAAT")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.