check_version: Check that version of an input or output object is up-to-date

View source: R/A_swGenericMethods.R

check_versionR Documentation

Check that version of an input or output object is up-to-date

Description

Check that version of an input or output object is up-to-date

Usage

check_version(
  object,
  expected_version = rSW2_version(),
  level = c("minor", "major", "patch", "devel")
)

Arguments

object

An object of class swInputData or swOutput.

expected_version

A numeric version. The object should have the same or a newer version number than the expected version; defaults to the current rSOILWAT2 version number.

level

A character string. The level at which to detect changes in the version number major.minor.patch.devel. For instance, a value of "minor" would ignore patch-level changes.

Value

A logical value.

See Also

validObject

Examples

# Should pass
check_version(rSOILWAT2::sw_exampleData, level = "minor")
check_version(rSOILWAT2::sw_exampleData, "1.0.0", level = "patch")

# May fail due to a recent patch
try(check_version(rSOILWAT2::sw_exampleData, level = "patch"))


Burke-Lauenroth-Lab/rSOILWAT2 documentation built on Dec. 9, 2023, 1:46 a.m.