lib.decide_version: Choose correct package version, and print decision.

View source: R/package_version_management.R

lib.decide_versionR Documentation

Choose correct package version, and print decision.

Description

Obtains the correct version based on the version instruction provided (e.g. >= 0.5). It will print which version is chosen if 'verbose = TRUE'. if no compatible version is found between the available versions, the function 'chooseVersion' will return an error to notify you.

Usage

lib.decide_version(
  packVersion,
  lib_location,
  pick.last = FALSE,
  print_version_choice = TRUE,
  warn_for_major_diff = TRUE
)

Arguments

packVersion

A named character vector with package names and their version indication (e.g. c(dplyr = '>= 0.4.0', ggplot = '')).

lib_location

The location of the R_MV_library folder.

pick.last

If a version like>= 0.5 is given and multiple versions exist, a choice needs to be made. By default it will take the first higher version (when it exists, just0.5, which is often the case). This because this is most likely to not change the behavior of the code. Picking the latest version is most compatible with matching other packages their dependencies (e.g. if a later package depends on this package but asks for> 0.6, it will crash). The downside of this is that an update could be a major one, going from0.5 to2.0, where allot of things can change and code is likely to not work anymore.

print_version_choice

if true, it will print the choices it made.

warn_for_major_diff

If true, the default, will return warnings if the loaded package is a major release higher then the package that was requested.


multiversion documentation built on March 22, 2022, 1:07 a.m.