API changes happen at set versions, and knowing how a current running version
relates to versions introducing API changes is important.
ClosestVersion approximages both “rounding down” (eg. to
determine minimum version with new API addition) and “rounding up”
(eg. to determine maximum version before API deletion) for semantic versions.
Usage
ClosestVersion(
query,
targets,
direction = c("min", "max"),
inclusive = direction == "min"
)Arguments
- query
A query version (
characterornumeric_version)- targets
A vector of target versions (
characterornumeric_version)- direction
Which way should we check for closest version? Choose from:
- min
Closest version less than or equal to
query- max
Closest version greater than or equal to
query
- inclusive
Perform an inclusive comparison (eg.
>=or<=versus to>or<) for “rounding”
Value
The version from targets that is closest to query as a
character vector