StatHourglass {gghourglass} | R Documentation |
A ggplot2 stat
function to wrangle data for geom_hourglass
.
Description
Splits mapped x
or y
aesthetic from a continuous datetime into
discrete date values on the mapped axis. The hour of day is mapped to
the opposite axis.
Usage
StatHourglass
stat_hourglass(
mapping = NULL,
data = NULL,
geom = "hourglass",
position = "identity",
show.legend = NA,
inherit.aes = TRUE,
hour_center = 0,
na.rm = FALSE,
...
)
Arguments
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. If |
geom |
Can be used to overwrite the default connection between |
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
hour_center |
The hour at which the time of day is centred. Default is 0, meaning midnight. -12 centres around noon of the preceding day, +12 centres around noon of the next day. |
na.rm |
If |
... |
Arguments passed as extra |
Format
An object of class StatHourglass
(inherits from Stat
, ggproto
, gg
) of length 7.
Value
Returns a ggplot2::layer()
which can be added to a ggplot2::ggplot()
Author(s)
Pepijn de Vries
Examples
stat_hourglass()