Sorts a vector of years into earliest-to-latest or latest-to-earliest
chronological order based on its era.
Usage
yr_sort(x, reverse = FALSE, ...)
Value
Sorted yr vector
Arguments
x
yr vector with era
reverse
Set FALSE (the default) for chronological order (earliest to
latest) or TRUE for reverse chronological order (latest to earliest).
...
Other arguments passed to sort(); in particular use na.last to
control NA handling.
Details
This is implemented as a prefixed function rather than an S3 sort() method
for yrs to avoid surprises when numerical (i.e. not chronological) sorting
is expected.
See Also
Other functions for chronological ordering and extremes:
yr_difference(),
yr_earlier_than(),
yr_extremes