ClosestVersion: Find the closest version

View source: R/zzz.R

ClosestVersionR Documentation

Find the closest version

Description

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 (character or numeric_version)

targets

A vector of target versions (character or numeric_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

See Also

numeric_version

Examples


SeuratDisk:::ClosestVersion('3.1.0', targets = c('3.0.0', '1.4.9', '4.3.2'))
SeuratDisk:::ClosestVersion('3.1.0', targets = c('3.0.0', '1.4.9', '4.3.2'), direction = 'max')



mojaveazure/seurat-disk documentation built on Nov. 5, 2023, 9:40 a.m.