hist2d: Two-dimensional histogram

hist2dR Documentation

Two-dimensional histogram

Description

Two-dimensional histogram

Usage

hist2d(x, breaks1 = "Sturges", breaks2 = "Sturges", right = TRUE, ...)

Arguments

x

Data frame or matrix with at least two columns. Only first two columns are used to tally frequencies.

breaks1

One of the following describing how breaks for the first variable are calculated:

  • Numeric vector: Breakpoints for bins for the first variable.

  • Single integer: The number of bins into which to tally values of the first variable.

  • Function: To compute the vector of breakpoints.

  • Function: To compute the number of cells. Used as a suggestion only (see hist).

  • Character: The name of a function to compute the number of cells (see the Details section in hist). Used as a suggestion only (see hist).

breaks2

Same as breaks1 but for the second variable.

right

Logical, if TRUE (default) then use left-open and right-closed intervals.

...

Arguments to pass to hist.

Value

Object of class matrix and histogram2d. Columns pertain to bins of x1 and rows x2. Column names and row names are mid-points of bins.

See Also

hist

Examples


x1 <- rnorm(1000)
x2 <- 0.5 * x1 * rnorm(1000)
x <- data.frame(x1=x1, x2=x2)
hist2d(x)


adamlilith/statisfactory documentation built on Jan. 3, 2024, 10:37 p.m.