View source: R/geom_kodom_periodic.R
| geom_kodom_periodic | R Documentation |
Draws concentric arcs representing cyclical longitudinal data. Time maps to
angle (one full revolution equals one period), and each subject's base
radius is determined by its lane rank. To separate successive cycles of the
same subject the radius drifts outward slightly as total time increases,
forming a star trail or Archimedean spiral.
geom_kodom_periodic(
mapping = NULL,
data = NULL,
stat = StatKodomPeriodic,
position = "identity",
...,
period = 12,
spiral_fraction = 0.1,
inner_fraction = 0.3,
lane_width = 1,
sort_by = "none",
n_max = Inf,
show_points = TRUE,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
A data frame. If |
stat |
The stat to use. Defaults to StatKodomLine. |
position |
Position adjustment, almost always |
... |
Other arguments passed to |
period |
Numeric. Length of one complete cycle (e.g. 12 for months,
24 for hours). Default |
spiral_fraction |
Numeric. Radial expansion per full cycle as a
fraction of one original lane width (i.e. before |
inner_fraction |
Fraction of total lanes used as a hollow inner buffer.
Default |
lane_width |
Positive numeric. Multiplier for the radial distance
between adjacent subject rings. Default |
sort_by |
Lane ordering. One of |
n_max |
Maximum number of subjects to display. A random sample is taken
when exceeded. Default |
show_points |
If |
na.rm |
If |
show.legend |
Logical. Should this layer appear in the legend? |
inherit.aes |
If |
Coordinate system. This geom is designed for use with
coord_polar(theta = "x"). Use coord_kodom_periodic() as a convenient
wrapper that sets start = pi/2 (12 o'clock at x = 0) and
direction = -1 (clockwise) by default.
Axis labels. Because x is continuous time, ggplot2 will automatically
expand the limits to cover the entire time range if you use standard scales,
which alters the length of a full 360-degree rotation. To make one rotation
exactly equal one period, use the included wrapper scale_x_kodom_periodic():
scale_x_kodom_periodic(period = 12, breaks = 1:12, labels = month.abb)
A ggplot2 layer object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.