histGram | R Documentation |
Creates either a frequency or density histogram.
histGram(x, breaks = "Sturges", Hist = list(), yaxis.range = c(NA, NA), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = "Auto", caption = "", margin = c(NA, NA, NA, NA), ...) ## Default S3 method: histGram(x, breaks = "Sturges", Hist = list(type = "frequency", fill = FALSE, boundary = "lower", line.color = "black", fill.color = "gray80"), yaxis.range = c(NA, NA), ylabels = 7, xlabels = 7, xtitle = deparse(substitute(x)), ytitle = "Auto", caption = "", margin = c(NA, NA, NA, NA), ...)
x |
a numeric vector to create the histogram |
breaks |
any valid value for |
Hist |
control parameters of the histogram. See Details. |
yaxis.range |
set the range for the y axis, the first value must be 0. |
ylabels |
the approximate number of labels for the y axis. |
xlabels |
the approximate number of labels for the x axis. The default value, "Auto" sets labels that are aligned with the breaks. |
xtitle |
x-axis title (also called x-axis caption). |
ytitle |
the y-axis title (also called y-axis caption), "Frequency" for a frequency histogram, "Density" for a density histogram. |
caption |
the figure caption. |
margin |
set the plot area margins, in units of lines of text. Generally
all NA or the output from |
... |
additional arguments for other methods. |
To set the x-axis range, you must specify numeric breaks that span the
complete range of x
.
The components of Hist
:
The type of the histogram. Must be one of "frequency" for actual counts in the bin, "density" for density in each bin, or "relative frequency" for percent in each bin.
Logical value, TRUE
means each bin will be shaded with fill.color
.
Defines how values tied to bin limit boundaires are handled. If "upper," then the bin limit boundary is the upper limit of the range and values tied to that value are placed in the bin corresponding to the upper limit of the boundary. If "lower," then the bijn limit is the lower limit of the bin.
The color of the lines around the bins.
The color the bins.
Information about the graph.
A call should be made to setPage
to set up the graphics
environment before calling histGram
.
#'Helsel, D.R., and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.
ecdfPlot
## Not run: set.seed(1) Xbig <- rnorm(100) setGD() histGram(Xbig, breaks=seq(-3, 3, by=.5), Hist=list(type="density")) # For more details of histGram see vignette(topic="ProbabilityPlots", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.