pace_formatter
takes a pace duration and returns a formatted string.
Arguments
- pace
A lubridate duration, returned by
lubridate::duration
or other methods in that family.
Details
This is most useful when plotting pace as one of the axes in a graph; rather than having the "number of seconds" as the axis value, this method can convert that to a more readable format.
Most commonly, using something like
ggplot2::scale_y_reverse(label = pace_formatter)
will ensure the y-axis
goes from "slowest" to "fastest", and shows paces like "8:30" rather than
"510"