.BG
.VE $Header: /usr3/s/current/s/.help/RCS/hist,v 1.2 83/12/30 19:29:03 rab Exp $
.FN hist
.TL
hist: Plot a Histogram
.CS
hist(x)  #simple form
hist(x, nclass, breaks, scale, plot, angle, density, col, inside)
.PP
.AG x
numeric vector of data for histogram.
.AG nclass
optional recommendation for the number of classes the
histogram should have.
Default is of the order of log to the base 2 of length of x.
.AG breaks
optional vector of the break points for the histogram
classes.  The first value of breaks should be smaller than
any data point; the last value of breaks should be larger
than any data point.  If omitted, evenly-spaced break points
are determined from `nclass' and the extremes of the data.
.AG scale
if TRUE, y axis will be on a density scale
(fraction of total count per fraction of x-range),
otherwise y will be counts.  Default FALSE.
This is useful for comparing histograms, because
histograms based on varying numbers of observations or linearly transformed
values will have similar y-axes.
.AG plot
if TRUE (default), the histogram will be plotted;
if FALSE, the vectors `counts' and `breaks' will be returned.
.PP
The `hist' function computes breakpoints, counts the number of points
within intervals, and then chains to the function `barplot' to do the
actual plotting.
Consequently, arguments to the `barplot' function that control shading, etc.,
can also be given to `hist'.
See `barplot' documentation for details of arguments
`angle', `density', `col',  and `inside'.
.PP
Graphical parameters may also be supplied as arguments to this
function (see `par').
.RT
if `plot' is FALSE, `hist' returns a structure
with components `counts' and `breaks'.
.RC counts
count or density in each bar of the histogram.
.RC breaks
break points between histogram classes.
.EX
hist(x)

hist(x,nclass=15)

# the example plot is produced by:
my.sample <-  rt(50,5)
lab <- "50 samples from a t distribution with 5 d. f."
hist(my.sample,main=lab)
.PI
.KW plot*
.KW histogram
.KW hplot*
.KW dplot*
.KW summary
.WR
