Description Usage Arguments Details Value See Also Examples
Bin data into intervals (1d).
1 2 | interval_bin(x, weight, breaks=interval_breaks(),
na.rm=FALSE, open="right")
|
x |
a numeric vector of positions |
weight |
|
breaks |
a vector of break points that should enclose all x values |
na.rm |
If |
open |
are intervals open on the |
To deal with floating point rounding issues, bin
positions are rounded slighty up or slightly down
(depending on whether open
is right or left). This
technique is adapted from hist
.
A data frame with three columns:
left |
the left end of the interval |
right |
the right end of the interval |
count |
the number of observations in that interval |
1 2 3 4 5 6 7 8 9 10 | x <- interval_bin(runif(100))
# Simple plot methoded included in package
plot(x)
# Selecting breaks:
interval_bin(runif(100), breaks = interval_breaks(bins = 10))
interval_bin(runif(100), breaks = interval_breaks(binwidth = 0.1))
interval_bin(runif(100), breaks = seq(0, 1, by = 0.2))
interval_bin(runif(100), breaks = scott_breaks())
interval_bin(runif(100), breaks = dhist_breaks())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.