side: integer indicating the axis side, passed to graphics::axis(). 1=bottom, 2=left, 3=top, 4=right.
x: character vector of axis labels
group_style: character string indicating the style of label:
"partial_grouped" - uses square bracket to bound 2+ repeated entries, and single line tick mark for non-repeated entries.
"grouped" - uses square bracket to bound each set of repeated entries including non-repeated entries.
"centered" - only labels the center of each group of repeated entries with no bracket bounding the entries.
las: integer indicating whether labels should be perpendicular, see graphics::par("las").
returnFractions: logical passed to breaksByVector() to calculate label positions. Set returnFractions=FALSE and all labels will only appear at integer locations on the axis.
nudge: numeric adjustment for labels away from the plot border.
do_abline: logical indicating whether to draw graphics::abline() lines inside the plot to indicate the exact breakpoints between each group of labels.
abline_lty: line type compatible with graphics::par("lty"), used when do_abline=TRUE.
abline_col: character color used when do_abline=TRUE.
do_plot: logical whether to plot the resulting axis, as an option to suppress the output and do something else with the data.frame of coordinates returned by this function.
...: additional arguments are passed to breaksByVector(), and/or to graphics::axis().
Returns
data.frame invisibly, which contains the relevant axis coordinates, labels, and whether the coordinate should appear with a tick mark.
Details
This function extends breaksByVector() specifically for axis labels. It is intended where character labels are spaced at integer steps, and some labels are expected to be repeated.