Description Usage Arguments Examples
Bin data into rectangles (2d).
1 2 3 | rect_bin(x, y, weight, xbreaks=interval_breaks(),
ybreaks=interval_breaks(), na.rm=FALSE, xopen="right",
yopen="right")
|
x |
a numeric vector of x positions |
y |
a numeric vector of y positions |
weight |
|
xbreaks |
a break function, or a vector of break points that should enclose all x values. |
ybreaks |
a break function, or a vector of break points that should enclose all y values. |
xopen |
are x intervals open on the |
yopen |
are y intervals open on the |
na.rm |
If |
1 2 3 4 5 6 7 8 9 | x <- rnorm(1e5)
y <- rnorm(1e5)
bins <- rect_bin(x, y)
plot(bins)
# Specifying bin widths
rect_bin(x, y,
xbreaks = interval_breaks(binwidth = 0.5),
ybreaks = interval_breaks(binwidth = 0.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.