Description Usage Arguments Examples
Each argument can either be NULL
, a vector of length 1 (which
will be used for both x and y directions), or a vector of length 2.
1 2 3 |
x, y |
Numeric vectors to guess parameters from. |
width |
(Positive real). The width of a bin. For S3 objects, the interpretation of width depends on the interpretation of the underlying numeric vector. For example, for dates, 1 = 1 day; for times 1 = 1 second; and for difftime, the units vary. If |
center |
Set the position of the first bin by specifying
the position of either a boundary or the center of a bin.
For example, you can always center the bins on integers with
Think of binning as tiling the real line into a infinite sequence of
intervals. |
boundary |
Set the position of the first bin by specifying
the position of either a boundary or the center of a bin.
For example, you can always center the bins on integers with
Think of binning as tiling the real line into a infinite sequence of
intervals. |
origin |
The locations of the left-most and right-most bins.
Any values outside this range will be treated as missing. You should
usually leave |
terminus |
The locations of the left-most and right-most bins.
Any values outside this range will be treated as missing. You should
usually leave |
bins |
Number of bins to use if not specified. Pretty bin sizes are preferred over matching this value exactly. |
pad |
If |
closed |
One of |
1 2 3 4 5 6 7 8 | bin_2d_fixed(runif(100), runif(100))
bin_2d_fixed(runif(100), runif(100), origin = 0)
bin_2d_fixed(runif(100), runif(100), width = 0.25)
bin_2d_fixed(runif(100), runif(100), bins = c(10, 100))
mat <- MASS::mvrnorm(1e6, mu = c(0, 0), matrix(c(1,0.5,0.5,1),2,2))
bins <- bin_2d_fixed(c(-3, 3), c(-3, 3))
system.time(out <- compute_stat(bins, mat[, 1], mat[, 2]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.