\HeaderA{shingles}{shingles}{shingles}
\aliasA{as.character.shingleLevel}{shingles}{as.character.shingleLevel}
\aliasA{as.data.frame.shingle}{shingles}{as.data.frame.shingle}
\aliasA{as.factorOrShingle}{shingles}{as.factorOrShingle}
\aliasA{as.shingle}{shingles}{as.shingle}
\aliasA{equal.count}{shingles}{equal.count}
\aliasA{is.shingle}{shingles}{is.shingle}
\aliasA{plot.shingle}{shingles}{plot.shingle}
\aliasA{print.shingle}{shingles}{print.shingle}
\aliasA{print.shingleLevel}{shingles}{print.shingleLevel}
\aliasA{shingle}{shingles}{shingle}
\aliasA{summary.shingle}{shingles}{summary.shingle}
\aliasA{[.shingle}{shingles}{[.shingle}
\keyword{print}{shingles}
\keyword{hplot}{shingles}
\keyword{methods}{shingles}
\keyword{classes}{shingles}
\begin{Description}\relax
Functions to handle shingles
\end{Description}
\begin{Usage}
\begin{verbatim}
shingle(x, intervals=sort(unique(x)))
equal.count(x, ...)
as.shingle(x)
is.shingle(x)

## S3 method for class 'shingle':
plot(x, panel, xlab, ylab, ...)

## S3 method for class 'shingle':
print(x, showValues = TRUE, ...)

## S3 method for class 'shingleLevel':
as.character(x, ...)

## S3 method for class 'shingleLevel':
print(x, ...)

## S3 method for class 'shingle':
summary(object, showValues = FALSE, ...)

## S3 method for class 'shingle':
as.data.frame(x, row.names = NULL, optional = FALSE)

## S3 method for class 'shingle':
x[subset, drop = FALSE]
as.factorOrShingle(x, subset, drop)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] numeric variable or R object, shingle in \code{plot.shingle} and
\code{x[]}. An object (list of intervals) of class "shingleLevel" in
\code{print.shingleLevel}

\item[\code{object}] shingle object to be summarized
\item[\code{showValues}] logical, whether to print the numeric part. If
FALSE, only the intervals are printed
\item[\code{row.names}] a character vector giving the row names for the data frame
\item[\code{optional}] logical.  If \code{TRUE}, setting row names is optional

\item[\code{intervals}] numeric vector or matrix with 2 columns
\item[\code{subset}] logical vector
\item[\code{drop}] whether redundant shingle levels are to be dropped
\item[\code{panel, xlab, ylab}] standard Trellis arguments (see
\code{\LinkA{xyplot}{xyplot}} ) 
\item[\code{...}] other arguments, passed down as appropriate.  For
example, extra arguments to \code{equal.count} are passed on to
\code{co.intervals}.  graphical parameters can be passed as
arguments to the \code{plot} method.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A shingle is a data structure used in Trellis, and is a generalization
of factors to \sQuote{continuous} variables.  It consists of a numeric
vector along with some possibly overlapping intervals. These intervals
are the \sQuote{levels} of the shingle.  The \code{levels} and
\code{nlevels} functions, usually applicable to factors, also work on
shingles.  The implementation of shingles is slightly different from
S.

There are print methods for shingles, as well as for printing the
result of \code{levels()} applied to a shingle.  For use in labelling,
the \code{as.character} method can be used to convert levels of a
shingle to character strings.

\code{equal.count} converts \code{x} to a shingle using the equal
count algorithm.  This is essentially a wrapper around
\code{co.intervals}.  All arguments are passed to \code{co.intervals}.

\code{shingle} creates a shingle using the given \code{intervals}. If
\code{intervals} is a vector, these are used to form 0 length
intervals.

\code{as.shingle} returns \code{shingle(x)} if \code{x} is not a
shingle.

\code{is.shingle} tests whether \code{x} is a shingle.

\code{plot.shingle} displays the ranges of shingles via
rectangles. \code{print.shingle} and \code{summary.shingle} describe
the shingle object.
\end{Details}
\begin{Value}
\code{x\$intervals} for \code{levels.shingle(x)}, 
logical for \code{is.shingle}, an object of class \code{"trellis"} for
\code{plot} (printed by default by \code{print.trellis}), and 
an object of class \code{"shingle"} for the others.
\end{Value}
\begin{Author}\relax
Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{xyplot}{xyplot}},
\code{\LinkA{co.intervals}{co.intervals}}, \code{\LinkA{Lattice}{Lattice}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
z <- equal.count(rnorm(50))
plot(z)
print(z)
print(levels(z))

\end{ExampleCode}
\end{Examples}

