Documentation for ggsced
ggsced as a lightweight alternative to fxl
The ggsced package was designed to provide a simple wrapper around the popular ggplot2 framework and plotting object. Specifically, for most users of ggplot active in the single-case design world, there have been a few specific cases where the gg framework hasn’t been easily adjusted to mirror visual conventions in peer-reviewed venues (e.g., Journal of Applied Behavior Analysis). The goal of the ggsced packages is to support users invested in the gg framework to minimize friction while using ggplot in their work being prepared for peer-review and publication.
Relevant Plotting Conventions
A full review of critical features in single-case design figures isn’t necessary here (see the fxl series for a relevant review) and instead the purpose of this series is to provide an overview of a few critical pinch-points for users of ggplot preparing figures for peer-review and publication.
The specific features often made challenging include (a) the preparation of un-connected or ‘broken’ axes and (b) the construction of dog-leg or connected phase-change lines. Each of these have a long history in visuals prepared for publication in the single-case design literature and are heavily emphasized (if not required) by editors of single-case design journals.
Unbroken Axes
The figure below illustrates the basic output provided by a ggplot object when faceting figures vertically. As a working default, the x/y axes do not separate and this is behavior that needs to be overridded in the plotting default.
Fortunately, some more recent expansions to the ggplot framework have supported more flexibility in this regard. Specifically, the scale{x/y}** helpers have been updated to augment the guides provided to each discrete axis (see below).
Connected Phase Change Lines
The more traditional challenges with the use of ggplot have been with phase change lines across multiple vertical facets. This represents a more meta case of annotations largely restricted to single-case design visuals and this is the primary purpose of the ggsced package.
An illustration of how ggsced extends the current capabilities of ggplot is provided below:
Summary and Recap
To briefly summarize, the ggsced package is designed as a simple extension to the popular ggplot framework. This package and this short series is provided as a means of supporting single-case design researchers use their R skills most effectively while meeting the unique challenges of accomodating historical conventions regarding figure construction.