Skip to content

Commit

Permalink
[SW-1848] Cleanup package.R in RSparkling
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubhava committed Jan 27, 2020
1 parent 287c1ac commit 3414674
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions r/src/R/package.R
@@ -1,29 +1,18 @@
#' @importFrom utils capture.output browseURL
#' @importFrom sparklyr spark_dependency register_extension invoke_static invoke spark_connection spark_dataframe sdf_register spark_context
#' @importFrom h2o h2o.getFrame h2o.getId h2o.init
#' @importFrom utils read.table
#' @importFrom utils packageVersion
NULL



# Verify H2O version
verify_h2o_version <- function(h2o_version, h2o_build_name, h2o_build_version, sw_version) {
current_h2o_version <- paste(packageVersion("h2o"))
if (current_h2o_version != h2o_version) {
message(paste0('\nDetected H2O ', current_h2o_version ,'. Please install H2O ', h2o_version ,', which is required for Sparkling Water ', sw_version ,'.\n
current_h2o_version <- paste(packageVersion("h2o"))
if (current_h2o_version != h2o_version) {
message(paste0('\nDetected H2O ', current_h2o_version, '. Please install H2O ', h2o_version, ', which is required for Sparkling Water ', sw_version, '.\n
To update your h2o R package, copy/paste the following commands and then restart your R session:
detach("package:rsparkling", unload = TRUE)
if ("package:h2o" %in% search()) { detach("package:h2o", unload = TRUE) }
if (isNamespaceLoaded("h2o")){ unloadNamespace("h2o") }
remove.packages("h2o")
install.packages("h2o", type = "source", repos = "https://h2o-release.s3.amazonaws.com/h2o/', h2o_build_name ,'/', h2o_build_version ,'/R")\n'))
}
install.packages("h2o", type = "source", repos = "https://h2o-release.s3.amazonaws.com/h2o/', h2o_build_name, '/', h2o_build_version, '/R")\n'))
}
}


# Define required spark packages
spark_dependencies <- function(spark_version, scala_version, ...) {

Expand All @@ -43,4 +32,3 @@ spark_dependencies <- function(spark_version, scala_version, ...) {
.onLoad <- function(libname, pkgname) {
register_extension(pkgname)
}

0 comments on commit 3414674

Please sign in to comment.