Create a Shingle Object

USAGE:

shingle(x, intervals = sort(unique(x))) 
is.shingle(x) 
as.shingle(x) 

ARGUMENTS:

x
a numeric vector
intervals
a two-column matrix of end-points, with column 1 defining the lower end of each interval and column 2 the upper end (inclusive on both ends); or a numeric vector of zero-width intervals.

VALUE:

object of class shingle: the numeric vector, x , with an intervals attribute as a two-column matrix of intervals. levels(x) will return the intervals attribute if x is a shingle.
is.shingle returns TRUE if x is a shingle object, FALSE otherwise.
as.shingle returns x, if x is a shingle, shingle(x) otherwise.

SEE ALSO:

.

EXAMPLES:

attach(galaxy) 
galaxy.marginal <- list(east.west = seq(-25, 25, length = 101), 
                        north.south = seq(-45, 45, length = 181)) 
galaxy.grid <- expand.grid(galaxy.marginal) 
gal.m <- loess(velocity ~ east.west * north.south, data = galaxy,
     span = 0.25, degree = 2, normalize = F, family = "symmetric") 
galaxy.fit <- predict(gal.m, galaxy.grid) 
given <- seq(min(galaxy.fit), max(galaxy.fit), length=49) 
plot(shingle(as.vector(galaxy.fit), 
     cbind(given[-length(given)], given[-1])), 
     xlab = "Velocity (km/sec)")