equal_count {ggcleveland} | R Documentation |
The equal count algorithm
Description
This function applies the equal count algorithm to divide a set of observations into intervals which can have certain level of ovelapping. It calls 'lattice::equal.count' but extends the output.
Usage
equal_count(df, vble, n_int = 6, frac = 0.5)
Arguments
df |
dataframe |
vble |
numeric variable to be analized |
n_int |
number of intervals |
frac |
overlapping fraction |
Value
a list with two elements:
- intervals
a tibble where each rows referes to one of the generated interval, with its lower and upper limits, number of values in it and number of values overlapping with the next interval
- df_long
a tibble in long format where each observation appears as many times as the number of intervals in which it belongs, with an identifier of the observation ('id', its position in the original data.frame) and an identifier of the interval.
Examples
equal_count(iris, Sepal.Length, 15, 0.3)
[Package ggcleveland version 0.1.0 Index]