Learn R Programming

h2o (version 3.38.0.1)

h2o.head: Return the Head or Tail of an H2O Dataset.

Description

Returns the first or last rows of an H2OFrame object.

Usage

h2o.head(x, n = 6L, m = 200L, ...)

# S3 method for H2OFrame head(x, n = 6L, m = 200L, ...)

h2o.tail(x, n = 6L, m = 200L, ...)

# S3 method for H2OFrame tail(x, n = 6L, m = 200L, ...)

Value

An H2OFrame containing the first or last n rows and m columns of an H2OFrame object.

Arguments

x

An H2OFrame object.

n

(Optional) A single integer. If positive, number of rows in x to return. If negative, all but the n first/last number of rows in x.

m

(Optional) A single integer. If positive, number of columns in x to return. If negative, all but the m first/last number of columns in x.

...

Ignored.

Examples

Run this code
if (FALSE) {
library(h2o)
h2o.init(ip <- "localhost", port = 54321, startH2O = TRUE)
australia_path <- system.file("extdata", "australia.csv", package = "h2o")
australia <- h2o.uploadFile(path = australia_path)
# Return the first 10 rows and 6 columns
h2o.head(australia, n = 10L, m = 6L)
# Return the last 10 rows and 6 columns
h2o.tail(australia, n = 10L, m = 6L)

# For Jupyter notebook with an R kernel,
# view all rows of a data frame
options(repr.matrix.max.rows = 600, repr.matrix.max.cols = 200)
}

Run the code above in your browser using DataLab