\HeaderA{hist.POSIXt}{Histogram of a Date or Date-Time Object}{hist.POSIXt}
\aliasA{hist.Date}{hist.POSIXt}{hist.Date}
\keyword{chron}{hist.POSIXt}
\keyword{dplot}{hist.POSIXt}
\keyword{hplot}{hist.POSIXt}
\begin{Description}\relax
Method for \code{\LinkA{hist}{hist}} applied to date or date-time objects.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'POSIXt':
hist(x, breaks, ...,
     xlab = deparse(substitute(x)),
     plot = TRUE, freq = FALSE,
     start.on.monday = TRUE, format)

## S3 method for class 'Date':
hist(x, breaks, ...,
     xlab = deparse(substitute(x)),
     plot = TRUE, freq = FALSE,
     start.on.monday = TRUE, format)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object inheriting from class \code{"POSIXt"} or \code{"Date"}.
\item[\code{breaks}] a vector of cut points \emph{or} number giving the number of
intervals which \code{x} is to be cut into \emph{or} an
interval specification, one of \code{"days"}, \code{"weeks"},
\code{"months"} or \code{"years"}, plus \code{"secs"}, \code{"mins"},
\code{"hours"} for date-time objects.

\item[\code{...}] graphical parameters, or arguments to
\code{\LinkA{hist.default}{hist.default}} such as \code{include.lowest},
\code{right} and \code{labels}.
\item[\code{xlab}] a character string giving the label for the x axis, if plotted.
\item[\code{plot}] logical.  If \code{TRUE} (default), a histogram is
plotted, otherwise a list of breaks and counts is returned.
\item[\code{freq}] logical; if \code{TRUE}, the
histogram graphic is a representation of frequencies, i.e,
the \code{counts} component of the result; if \code{FALSE},
\emph{relative} frequencies (probabilities) are plotted.
\item[\code{start.on.monday}] logical. If \code{breaks = "weeks"}, should the
week start on Mondays or Sundays?
\item[\code{format}] for the x-axis labels. See \code{\LinkA{strptime}{strptime}}.
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of class \code{"histogram"}: see \code{\LinkA{hist}{hist}}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{seq.POSIXt}{seq.POSIXt}}, \code{\LinkA{axis.POSIXct}{axis.POSIXct}}, \code{\LinkA{hist}{hist}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
hist(.leap.seconds, "years", freq = TRUE)
hist(.leap.seconds,
     seq(ISOdate(1970, 1, 1), ISOdate(2010, 1, 1), "5 years"))

## 100 random dates in a 10-week period
random.dates <- as.Date("2001/1/1") + 70*stats::runif(100)
hist(random.dates, "weeks", format = "%d %b")
\end{ExampleCode}
\end{Examples}

