Description Usage Arguments Value Examples
used for binning the numeric values by empirical quantile
1 | quant_bin_1d(xs, nbin, output = "data", jit = 0)
|
xs |
Numeric vector of values to be binned |
nbin |
An integer defining the number of bins to partion the xs into |
output |
Output Structure: "data" for just the binned data,"definition" for a list of bin centers and boundaries, or "both" for list containing both data and definition |
jit |
non-negative value to specify a random uniform jitter to the observed values prior to partitioning by quantiles. |
output as specified
1 2 3 4 5 6 7 8 9 10 | quant_bin_1d(ggplot2::diamonds$price,4,output="data")
quant_bin_1d(ggplot2::diamonds$price,4,output="definition")
quant_bin_1d(runif(1000,0,10),nbin=4,output="both")
Speed test
load("~/onePercentSample.Rdata")
timer <- Sys.time()
quant_bin_1d(onePercentSample$total_amount,100,output="data", jit=.00001)
Sys.time()-timer
Note: using .bincode() this take ~2 seconds instead of ~10 seconds with for loop overwrite from original
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.