View source: R/geomStepRibbon.R
geom_stepribbon | R Documentation |
Modified from RmcdrPlugin.KMggplot2
step ribbon plots.
geom_stepribbon(
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. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to |
geom_stepribbon
is an extension of the geom_ribbon
, and
is optimized for Kaplan-Meier plots with pointwise confidence intervals
or a confidence band.
geom_ribbon
geom_stepribbon
inherits from geom_ribbon
.
geom_stepribbon
is modified from
RcmdrPlugin.KMggplot2::geom_stepribbon
.
huron <- data.frame(year = 1875:1972, level = as.vector(LakeHuron))
h <- ggplot2::ggplot(huron, ggplot2::aes(year))
h + geom_stepribbon(ggplot2::aes(ymin = level - 1, ymax = level + 1),
fill = "grey70") +
ggplot2::geom_step(ggplot2::aes(y = level))
# contrast ggplot2::geom_ribbon with geom_stepribbon:
h + ggplot2::geom_ribbon(ggplot2::aes(ymin = level - 1, ymax = level + 1),
fill = "grey70") +
ggplot2::geom_line(ggplot2::aes(y = level))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.