Given a vector of time values in original units, this function selects new time units such that, when time is rescaled to the new units, the midpoint of the time vector is as close to 10 as possible.
auto_units(y, from, target = 10, period_units = time_units)
Character: Automatically-selected new time units, which will be one of `period_units`.
A numeric vector of time values
The original units of `y`
The target value (order of magnitude) for the midpoint of rescaled time values. Default 10.
A list of acceptable/understood time units. See Details. Default `time_units`.
Caroline Ring
# Acceptable/understood time units in `period_units`
``` c("picoseconds", "nanoseconds", "microseconds", "milliseconds", "seconds", "minutes", "hours", "days", "weeks", "months", "years") ```