Checks whether the currently running RStudio version is >= a cached reference version. Intended to level up the RStudio version in use between multiple users of the same code (e.g. contributors to a specific R project).
Value
Currently running RStudio version as a numeric version, or NULL if RStudio is not running, invisibly.
Details
If the file path_min_vrsn exists, it is checked whether RStudio is running, and if so, whether its version number is greater than or equal to the version
number stored in that file. If this is not the case, an alert is displayed.
If update_min_vrsn is set to TRUE and the file path_min_vrsn doesn't exist or contains an RStudio version string that's lower than the currently
running version of RStudio, path_min_vrsn is overwritten with the currently running RStudio version string.
Note that since RStudio must be running for lvl_up_rstudio() to have any effect, it can't be directly called in a (project-level)
.Rprofile
startup script. Instead, the rstudio.sessionInit hook can be used.
Example:
setHook(hookName = "rstudio.sessionInit",
value = function(newSession) {
if (newSession)
salim::lvl_up_rstudio(path_min_vrsn = ".RStudio_version",
update_min_vrsn = TRUE)
},
action = "append")See also
Other development environment currentness functions:
lvl_up_quarto(),
lvl_up_r(),
update_rpkgs(),
update_salims_pkgs(),
update_zdaarau_pkgs()