utils-binning2 | R Documentation |
Two functions which allow to create histograms due to sqaure and hexagonal binning.
squareBinning(x, y = NULL, bins = 30)
hexBinning(x, y = NULL, bins = 30)
## S3 method for class 'squareBinning'
plot(x, col = heat.colors(12), addPoints = TRUE,
addRug = TRUE, ...)
## S3 method for class 'hexBinning'
plot(x, col = heat.colors(12), addPoints = TRUE,
addRug = TRUE, ...)
addPoints |
a logical flag, should the center of mass points added to the plot? |
addRug |
a logical flag, should a rug representation be added to the
plot, for details see the function |
bins |
an integer specifying the number of bins. |
col |
color map like for the |
x, y |
[squareBinning][hexBinning] - |
... |
arguments to be passed. |
squareBinning
does a square binning of data points, and
hexBinning
does a hexagonal binning of data points.
A list with three entries, x
, y
and z
,
specified by an oject of class squareBinning
or
hexBinning
.
Note, the returned value, can be directly used by the persp()
and contour
3D plotting functions.
Diethelm Wuertz for the Rmetrics R-port.
## squareBinning -
sB <- squareBinning(x = rnorm(1000), y = rnorm(1000))
plot(sB)
## hexBinning -
hB <- hexBinning(x = rnorm(1000), y = rnorm(1000))
plot(hB)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.