Create a factor column with the data subseted according to break points.

level_shift(x, level_breaks = NULL)

Arguments

x

vector of numeric

level_breaks

break points in the data

Value

vector of type factor

Examples

level_shift(1:100, c(2, 40, 86))
#> [1] [1,2] [1,2] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] #> [9] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] #> [17] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] #> [25] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] #> [33] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] (2,40] #> [41] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] #> [49] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] #> [57] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] #> [65] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] #> [73] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] #> [81] (40,86] (40,86] (40,86] (40,86] (40,86] (40,86] (86,100] (86,100] #> [89] (86,100] (86,100] (86,100] (86,100] (86,100] (86,100] (86,100] (86,100] #> [97] (86,100] (86,100] (86,100] (86,100] #> Levels: [1,2] (2,40] (40,86] (86,100]