histogram | R Documentation |
Create a histogram of single variables.
histogram(x, data, type = "count", fit, ...)
x |
|
data |
data frame. The data where the variables can be found. |
type |
character. A character string that describes what units the user would like on the y-axis. Options include |
fit |
character. A character string that describes a probablility density curve to overlay on the histogram of the data. Distributions that can be used are |
nint |
number. The number of bins to use in the histogram |
breaks |
Usually a numeric vector of length (number of bins + 1) defining the breakpoints of the bins. Note that when breakpoints are not equally spaced, the only value of type that makes sense is density. |
For additional options for creating histogram, look at the help file found in the lattice
package or run help(histogram, package="lattice")
in the console.
data(cdc)
histogram(~height, data = cdc)
histogram(~height, data = cdc, fit = "normal")
histogram(~height | gender, data = cdc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.