Returns either a version extracted from a given object or the default version.

getRVersionTag(from, default = paste(R.Version()$major,
  R.Version()$minor, sep = "."))

Arguments

from

the source to extract an R version: a `sessionInfo()` or `session_info()` object, a `description` object, or an `RData` file with a session info object

default

if 'from' does not contain version information (e.g. its an Rscript), use this default version information.

Examples

getRVersionTag(from = sessionInfo())
#> [1] "3.6.1"