powered by
Two-dimensional histogram
hist2d(x, breaks1 = "Sturges", breaks2 = "Sturges", right = TRUE, ...)
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.
matrix
histogram2d
x1
x2
Data frame or matrix with at least two columns. Only first two columns are used to tally frequencies.
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).
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).
Same as breaks1 but for the second variable.
breaks1
Logical, if TRUE (default) then use left-open and right-closed intervals.
TRUE
Arguments to pass to hist.
x1 <- rnorm(1000) x2 <- 0.5 * x1 * rnorm(1000) x <- data.frame(x1=x1, x2=x2) hist2d(x)
Run the code above in your browser using DataLab