Skip to contents

Places one point per observation at its heading angle, stacking coincident angles radially to avoid overplotting. If stack_r is already a column in data (from a prior call to stack_headings), it is used as-is; otherwise stacking is computed internally.

Usage

add_stacked_headings(
  data,
  col = NULL,
  step = 0.025,
  start_sep = step/2,
  tol = NULL,
  direction = "inward",
  base_r = 1,
  shade = FALSE,
  shape = FALSE,
  group = NULL,
  colour = "black",
  colour_col = NULL,
  size = 2,
  alpha = 1,
  axial = FALSE,
  ...,
  color = NULL,
  color_col = NULL
)

Arguments

data

A data frame with an angle column in radians, typically a headings_frame.

col

Name of the angle column. Defaults to the heading_col attribute when data is a headings_frame.

step, start_sep, tol, direction, base_r

Passed to stack_headings when stack_r is absent. See that function for details. step sets the gap between dots and start_sep (default step / 2) offsets the first dot inward from the reference circle so its outer edge approximately abuts the circumference.

shade

If TRUE, map stack_n to the alpha aesthetic (scaled 0.2–1 across the observed range). Overrides the fixed alpha argument.

shape

Passed to stack_headings to request per-observation shape encoding. Shape is also applied when shape_code is already a column in data. Mapped to ggplot2 shape integers: 1 = hollow, 16 = filled, 21 = filled with ring.

group

Optional column name; stack within each group independently (e.g. one stacking per facet). Default NULL.

colour, color

Fixed point colour (ignored when colour_col is set). color is the American-spelling alias.

colour_col, color_col

Optional column name to map to the colour aesthetic. color_col is the American-spelling alias.

size

Point size passed to geom_point().

alpha

Fixed alpha. Ignored when shade = TRUE.

axial

Logical; when `TRUE`, mirror each observation to `col + pi` before stacking, so the figure reads as bidirectional. Stacking is computed after mirroring, so each antipodal cluster stacks within itself. Default `FALSE`.

...

Additional arguments passed to ggplot2::geom_point().

Value

A geom_point() layer.