h2o.init(ip = "127.0.0.1", port = 54321, startH2O = TRUE,
forceDL = FALSE, Xmx, beta = FALSE, assertion = TRUE, license = NULL,
nthreads = -2, max_mem_size = NULL, min_mem_size = NULL,
ice_root = tempdir(), strict_version_check = TRUE, https = FALSE,
insecure = FALSE, username = NA_character_, password = NA_character_)
character
representing the hostname or IP address of the server where H2O is running.numeric
representing the port number of the H2O server.logical
value indicating whether to try to start H2O from R if no connection with H2O is detected. This is only possible if ip = "localhost"
or ip = "127.0.0.1"
. If an existing connection is detected, Rlogical
value indicating whether to force download of the H2O executable. Defaults to FALSE, so the executable will only be downloaded if it does not already exist in the h2o R library resources directory h2o/java/h2o.jar
character
string specifying the maximum size, in bytes, of the memory allocation pool to H2O. This value must a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicatelogical
value indicating whether H2O should launch in beta mode. This value is only used when R starts H2O.logical
value indicating whether H2O should be launched with assertions enabled. Used mainly for error checking and debugging purposes. This value is only used when R starts H2O.character
string value specifying the full path of the license file. This value is only used when R starts H2O.character
string specifying the maximum size, in bytes, of the memory allocation pool to H2O. This value must a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicate gigabytes. character
string specifying the minimum size, in bytes, of the memory allocation pool to H2O. This value must a multiple of 1024 greater than 2MB. Append the letter m or M to indicate megabytes, or g or G to indicate gigabytes. H2OConnection
object containing the IP address and port number of the H2O server.start = TRUE
with ip = "localhost"
, it will attempt to start and instance of H2O at localhost:54321. Otherwise it stops with an error.When initializing H2O locally, this method searches for h2o.jar in the R library resources (system.file("java", "h2o.jar", package = "h2o")
), and if the file does not exist, it will automatically attempt to download the correct version from Amazon S3. The user must have Internet access for this process to be successful.
Once connected, the method checks to see if the local H2O R package version matches the version of H2O running on the server. If there is a mismatch and the user indicates she wishes to upgrade, it will remove the local H2O R package and download/install the H2O R package from the server.
h2o.shutdown
for shutting down from R.# Try to connect to a local H2O instance that is already running.
# If not found, start a local H2O instance from R with the default settings.
localH2O = h2o.init()
# Try to connect to a local H2O instance.
# If not found, raise an error.
localH2O = h2o.init(startH2O = FALSE)
# Try to connect to a local H2O instance that is already running.
# If not found, start a local H2O instance from R with 5 gigabytes of memory.
localH2O = h2o.init(max_mem_size = "5g")
Run the code above in your browser using DataLab