shingles | R Documentation |
Shingles are a generalization of factors to continuous variables. Cleveland-style shingles distribute the range of a continuous variable into overlapping discrete intervals, which can be more useful for visualization than mutually-exclusive bins.
shingles(x, breaks, overlap = 0.5, labels = NULL)
x |
A numeric vector. |
breaks |
Either the number of intervals or a matrix of breaks (as returned by |
overlap |
The fraction of overlap between intervals. |
labels |
The names of the intervals. |
A list giving the indices of x
in each shingle with the following attributes:
breaks
: A matrix where each row gives the lower and upper limits for each shingle.
counts
: The number of observations in each shingle.
mids
: The center of each shingle.
Kylie A. Bemis
W. S. Cleveland. Visualizing Data. New Jersey: Summit Press. 1993.
co.intervals
set.seed(1)
x <- rnorm(100)
shingles(x, 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.