The “h2o.assign” Function in R

  • Package: h2o

  • Purpose: To assign an H2OFrame to a key in the H2O cluster’s key-value store.

  • General Class: Data Manipulation

  • Required Argument(s):

    • data: An H2OFrame object to be assigned.

    • key: Character. The key to assign the object to in the H2O cluster.

  • Notable Optional Arguments:

    • None

  • Example (with Explanation):

  • # Load necessary package
    library(h2o)

    # Initialize H2O
    h2o.init()

    # Create an H2OFrame
    data <- as.h2o(iris)

    # Assign the H2OFrame to a key in the H2O cluster
    h2o.assign(data = data, key = "iris_data")

    # View the keys in the H2O cluster
    h2o.ls()

  • In this example, the h2o.assign function from the h2o package is used to assign an H2OFrame object named “data” to a key named “iris_data” in the H2O cluster’s key-value store. This function is commonly used to store intermediate results or manipulate data within the H2O cluster. After assigning the object, the h2o.ls function is used to view the keys currently stored in the H2O cluster.

Previous
Previous

The “h2o.uploadFile” Function in R

Next
Next

The “h2o.importFile” Function in R