Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
egillax opened this issue Oct 21, 2024 · 1 comment
Open

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

egillax opened this issue Oct 21, 2024 · 1 comment

Comments

@egillax
Copy link

egillax commented Oct 21, 2024

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
Copy link
Author

egillax commented Oct 21, 2024

This was reported by a PLP user OHDSI/PatientLevelPrediction#493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant