Learn R Programming

h2o (version 2.4.3.11)

h2o.table: Cross Tabulation of H2O Data

Description

Uses the cross-classifying factors to build a table of counts at each combination of factor levels.

Usage

h2o.table(x)

Arguments

x
An H2OParsedData object with at most two integer or factor columns.

Value

  • A H2OParsedData object containing the contingency table. If x has a single column, this will just be the counts of each factor level.

Examples

Run this code
library(h2o)
localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE)
prosPath = system.file("extdata", "prostate.csv", package="h2o")
prostate.hex = h2o.importFile(localH2O, path = prosPath, key = "prostate.hex")
summary(prostate.hex)

# Counts of the ages of all patients
head(h2o.table(prostate.hex[,3]))

# Two-way table of ages (rows) and race (cols) of all patients
head(h2o.table(prostate.hex[,c(3,4)]))

Run the code above in your browser using DataLab