OHDSI / OhdsiShinyModules

An R package containing Shiny modules used by various OHDSI Shiny apps
https://ohdsi.github.io/OhdsiShinyModules/
8 stars 11 forks source link

is_installed helper function does not work in R4.4.x #365

Open egillax opened 7 hours ago

egillax commented 7 hours ago

This snippet here from helpers-install.R:

is_installed <- function (pkg, version = 0) {
  installed_version <- tryCatch(utils::packageVersion(pkg), 
                                error = function(e) NA)
  !is.na(installed_version) && installed_version >= version
}

Doesn't work in R>=4.4 . The comparison installed_version >= version fails because installed_version is a packageVersion object and can't be compared to a numeric anymore. The fix is to change it to:

installed_version >= as.character(version)

egillax commented 7 hours ago

This was reported by a PLP user https://github.com/OHDSI/PatientLevelPrediction/issues/493