diff --git a/R/core_commons.R b/R/core_commons.R index 4e862015a1670eeb9b64e6395304b0e3453aae49..0413a4563a3fcd7c53cf23290ef7ee705e9e762f 100644 --- a/R/core_commons.R +++ b/R/core_commons.R @@ -41,6 +41,12 @@ require.auto <- function(x){ } } +check_version = function(pkg_name, min_version) { + cur_version = packageVersion(pkg_name) + if(cur_version < min_version) stop(sprintf("Package %s needs a newer version, + found %s, need at least %s", pkg_name, cur_version, min_version)) +} +#check_version("dplyr", "0.4-1") ######################################################################################################################## ## load core packages