Learn R Programming

h2o (version 3.44.0.3)

h2o.hist: Compute A Histogram

Description

Compute a histogram over a numeric column. If breaks=="FD", the MAD is used over the IQR in computing bin width. Note that we do not beautify the breakpoints as R does.

Usage

h2o.hist(x, breaks = "Sturges", plot = TRUE)

Arguments

x

A single numeric column from an H2OFrame.

breaks

Can be one of the following: A string: "Sturges", "Rice", "sqrt", "Doane", "FD", "Scott" A single number for the number of breaks splitting the range of the vec into number of breaks bins of equal width A vector of numbers giving the split points, e.g., c(-50,213.2123,9324834)

plot

A logical value indicating whether or not a plot should be generated (default is TRUE).

Examples

Run this code
if (FALSE) {
library(h2o)
h2o.init()

f <- "https://h2o-public-test-data.s3.amazonaws.com/smalldata/iris/iris_train.csv"
iris <- h2o.importFile(f)
h2o.asnumeric(iris["petal_len"])
h2o.hist(iris["petal_len"], breaks = "Sturges", plot = TRUE)
}

Run the code above in your browser using DataLab