The “h2o.dim” Function in R
Package: h2o
Purpose: To retrieve the dimensions (number of rows and columns) of an H2O data frame.
General Class: Data Retrieval
Required Argument(s):
x: H2OFrame. The H2O data frame for which dimensions are retrieved.
Notable Optional Arguments:
None
Example (with Explanation):
# Load necessary package
library(h2o)
# Initialize H2O
h2o.init()
# Load a sample dataset
data <- h2o.importFile("https://s3.amazonaws.com/h2o-public-test-data/smalldata/iris/iris_wheader.csv")
# Retrieve dimensions of the dataset
dimensions <- h2o.dim(data)
# Print the dimensions
print(dimensions)In this example, the h2o.dim function from the h2o package is used to retrieve the dimensions (number of rows and columns) of the iris dataset loaded into an H2O data frame. The retrieved dimensions are then printed.