geom_ubar | R Documentation |
I've been using geom_segment
more to make "bar" charts, setting
xend
to whatever x
is and yend
to 0
. The bar widths remain
constant without any tricks and you have granular control over the
segment width. I decided it was time to make a geom
.
geom_ubar(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
'geom_ubar“ understands the following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
group
linetype
size
library(ggplot2)
data(economics)
ggplot(economics, aes(date, uempmed)) +
geom_ubar()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.