Skip to contents

Create interval with value rounded down and up to nearest number specified

Usage

rounded_interval(data, round = 5, down = TRUE)

Arguments

data

numeric vector

round

number to round to

down

round down on tie? Default is TRUE. Rounds up if FALSE.

Value

vector

Examples

1:10 |> rounded_interval(round=2)
#> 0-2
#> 2-4
#> 2-4
#> 4-6
#> 4-6
#> 6-8
#> 6-8
#> 8-10
#> 8-10
#> 10-12