View source: R/breaks_to_interval.R

breaks_to_interval | R Documentation |

`breaks_to_interval()`

takes a specified set of breaks representing the left
hand limits of a closed open interval, i.e [x, y), and returns the
corresponding interval and upper bounds. The resulting intervals span from
the minimum break through to a specified `max_upper`

.

```
breaks_to_interval(breaks, max_upper = Inf)
```

`breaks` |
1 or more non-negative cut points in increasing (strictly) order. These correspond to the left hand side of the desired intervals (e.g. the closed side of [x, y). Double values are coerced to integer prior to categorisation. |

`max_upper` |
Represents the maximum upper bound splitting the data. Defaults to |

A data frame with an ordered factor column (`interval`

), as well as columns
corresponding to the explicit bounds (`lower_bound`

and `upper_bound`

). Note
these bounds are returned as `<numeric>`

to allow the maximum upper bound to
be `Inf`

.

```
brks <- c(0L, 1L, 5L, 15L, 25L, 45L, 65L)
breaks_to_interval(breaks = brks)
breaks_to_interval(breaks = brks, max_upper = 100L)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.