equal_count: The equal count algorithm

Description Usage Arguments Value Examples

View source: R/equal_count.R

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

1
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

1
equal_count(iris, Sepal.Length, 15, 0.3)

ggcleveland documentation built on Aug. 16, 2021, 9:07 a.m.