Testing availability of optional package, its version, and extra global default. This function is used internally. It is exported and documented because user can control behavior of the function by global option.

use.package(package, version = "1.9.8"[package == "data.table"],
  use = getOption("h2o.use.data.table", FALSE)[package == "data.table"])

Arguments

package

character scalar name of a package that we Suggests or Enhances on.

version

character scalar required version of a package.

use

logical scalar, extra escape option, to be used as global option.

Details

We use this function to control csv read/write with optional data.table package. Currently data.table is disabled by default, to enable it set options("h2o.use.data.table"=TRUE). It is possible to control just fread or fwrite with options("h2o.fread"=FALSE, "h2o.fwrite"=FALSE). h2o.fread and h2o.fwrite options are not handled in this function but next to fread and fwrite calls.

See also

as.h2o.data.frame, as.data.frame.H2OFrame

Examples

# NOT RUN {
op <- options("h2o.use.data.table" = TRUE)
if (use.package("data.table")) {
  cat("optional package data.table 1.9.8+ is available\n")
} else {
  cat("optional package data.table 1.9.8+ is not available\n")
}
options(op)
# }