h2o (version 3.10.5.2)

as.h2o: Create H2OFrame

Description

Import R object to the H2O cloud.

Usage

as.h2o(x, destination_frame = "", ...)

# S3 method for default as.h2o(x, destination_frame = "", ...)

# S3 method for H2OFrame as.h2o(x, destination_frame = "", ...)

# S3 method for data.frame as.h2o(x, destination_frame = "", ...)

# S3 method for Matrix as.h2o(x, destination_frame = "", ...)

Arguments

x

An R object.

destination_frame

A string with the desired name for the H2OFrame.

arguments passed to method arguments.

Details

Method as.h2o.data.frame will use fwrite if data.table package is installed in required version.

References

http://blog.h2o.ai/2016/04/fast-csv-writing-for-r/

See Also

use.package

Examples

Run this code

h2o.init()
hi <- as.h2o(iris)
he <- as.h2o(euro)
hl <- as.h2o(letters)
hm <- as.h2o(state.x77)
hh <- as.h2o(hi)
stopifnot(is.h2o(hi), dim(hi)==dim(iris),
          is.h2o(he), dim(he)==c(length(euro),1L),
          is.h2o(hl), dim(hl)==c(length(letters),1L),
          is.h2o(hm), dim(hm)==dim(state.x77),
          is.h2o(hh), dim(hh)==dim(hi))
if (requireNamespace("Matrix", quietly=TRUE)) {
  data <- rep(0, 100)
  data[(1:10)^2] <- 1:10 * pi
  m <- matrix(data, ncol = 20, byrow = TRUE)
  m <- Matrix::Matrix(m, sparse = TRUE)
  hs <- as.h2o(m)
  stopifnot(is.h2o(hs), dim(hs)==dim(m))
}

Run the code above in your browser using DataLab