h2o (version 3.2.0.3)

apply,H2OFrame-method: Apply on H2O Datasets

Description

Method for apply on H2OFrame objects. Closures are not supported: an error message stating this fact will stop execution.

Usage

## S3 method for class 'H2OFrame':
apply(X, MARGIN, FUN, ...)

Arguments

X
an H2OFrame object on which apply will operate.
MARGIN
the vector on which the function will be applied over, either 1 for rows or 2 for columns.
FUN
the function to be applied.
...
optional arguments to FUN.

Value

  • Produces a new H2OFrame of the output of the applied function. The output is stored in H2O so that it can be used in subsequent H2O processes.

See Also

apply for the base generic

Examples

Run this code
localH2O = h2o.init()
irisPath = system.file("extdata", "iris.csv", package="h2o")
iris.hex = h2o.importFile(localH2O, path = irisPath, destination_frame = "iris.hex")
summary(apply(iris.hex, 1, sum))

Run the code above in your browser using DataLab