binvec | R Documentation |
Summarize a vector in the bins at the specified indices.
binvec(x, lower, upper, stat = "sum", prob = 0.5)
x |
A numeric vector. |
lower , upper |
The (inclusive) lower and upper indices of the bins |
stat |
The statistic used to summarize the values in each bin. Must be one of "sum", "mean", "max", "min", "sd", "var", "mad", or "quantile". |
prob |
The quantile for |
An numeric vector of the summarized (binned) values.
Kylie A. Bemis
set.seed(1)
x <- sort(runif(20))
binvec(x, c(1,6,11,16), c(5,10,15,20))
binvec(x, seq(from=1, to=16, by=5), stat="mean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.