shingles {lattice}R Documentation

shingles

Description

Functions to handle shingles

Usage

shingle(x, intervals=sort(unique(x)))
equal.count(x, ...)
as.shingle(x)
is.shingle(x)
plot(x, col, aspect, ...)
print(x, ...)
print(x, ...)
summary(object, ...)
x[subset, drop = FALSE]
as.factorOrShingle(x, subset, drop)

Arguments

x numeric variable or R object, shingle in plot.shingle, x[]. An object (list of intervals) of class "shingleLevel" in print.shingleLevel
object shingel object to be summarized
intervals numeric vector or matrix with 2 columns
subset logical vector
drop whether redundant shingle levels are to be dropped
col color to fill the rectangles, defaults to bar.fill$col
aspect aspect ratio
... other arguments, passed to co.intervals

Details

A shingle is a data structure used in Trellis, and is meant to be a generalization of factors to `continuous' variables. It consists of a numeric vector along with some possibly overlapping intervals. These intervals are the `levels' of the shingle. The levels and nlevels functions, usually applicable to factors, are also applicable to shingles.

There are print methods for shingles, as well as for printing the result of levels() applied to a shingle.

The implementation of shingles is slightly different from S.

plot.shingle is not quite as it should be yet, in the sense that most options allowed in Trellis is currently ignored. Should be fixed soon.

equal.count Converts x to a shingle. Essentially a wrapper around co.intervals. All arguments are passed to co.intervals

shingle creates a shingle using the given intervals. If intervels is a vector, these are used to form 0 length intervals.

as.shingle returns shingle(x) if x is not a shingle.

is.shingle tests whether x is a shingle.

plot.shingle displays the ranges of shingles via rectangles. print.shingle and summary.shingle describe the shingle object.

Value

x$intervals for levels.shingle(x), logical for is.shingle, an object of class ``trellis'' for plot (printed by default by print.trellis), and an object of class ``shingle'' for the others.

Author(s)

Deepayan Sarkar deepayan@stat.wisc.edu

See Also

xyplot, co.intervals, Lattice

Examples

z <- equal.count(rnorm(50))
plot(z)
print(z)
print(levels(z))

[Package Contents]