Bins angles (in radians) into fixed-width sectors and returns each angle
snapped to its bin's centre. Snapping coincident-binned angles to a common
value is the standard precursor to a stacked dot plot: feed the result to
stack_headings (with the default tol = NULL) to build
clean radial columns.
Arguments
- angles
Numeric vector of angles in radians.
NAis preserved.- width
Bin width in radians; must be a single positive number. For a 5-degree bin use
pi / 36.- phase
Radian location of a bin centre. The default
0places bin centres at0, width, 2 * width, ..., so the reference direction sits on a column rather than on a bin boundary. Setphase = width / 2to reproduce the edge-aligned bins ofcircular::plot.circular(centres atwidth / 2,3 * width / 2, ...). Any phase is allowed – e.g. withwidth = pi / 2, phase = pi / 4the bin boundaries fall on the axes, binning by quadrant.
Value
A numeric vector the same length as angles, each value snapped
to its bin centre and wrapped to [0, 2 * pi).