View source: R/bin_integer_into_integer.R
bin_integer_into_integer | R Documentation |
This function bins decimal numbers to their lower or upper values. This is particularly useful for semi-quantitative modelling, in case there is a preference for a set of values.
bin_integer_into_integer(x, multiples, include.lowest = FALSE)
x |
A 'numeric' vector |
multiples |
An 'integer' or 'numeric' vector to bin 'x' by. For example, |
include.lowest |
Do you want to include upper or lower values in the bin? eg: Take 'multiples = 5', the ranges will be [0,5), [5,10), ..., if FALSE, (0,5], (5,10], ... |
A integer
vector
data(mtcars) bin_integer_into_integer(mtcars$mpg, multiples = 10, include_highest= TRUE) bin_integer_into_integer(mtcars$mpg, multiples = 5, include_highest= FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.