Create a ggplot2
object with a line for each sample that
spans from its pre-training to post-training value.
plot_pre_post(x, pre, post, stats = NULL, ymin, ymax)
data.frame
with pre and post values. The data should be
filtered to a specific age and sex.
character; name of a column in x
containing pre-training
values.
character; name of a column in x
containing post-training
values.
data.frame
with post - pre stats for each training group.
The data should be filtered to a specific measure, age, and sex.
numeric; lower bound on y-axis.
numeric; lower bound on y-axis.
A ggplot
object.
Lines are colored according to whether the change from pre to post is an increase (red) or decrease (blue). If the pre and post values are the same (no change), a black point is used instead of a line. Originally, the post end of each line terminated in an arrow, but the final figure panels were too small to display them properly. Also, the arrows were somewhat misleading when the post - pre differences were small enough to be hidden by the arrow heads.