round_precision {YAPSA} | R Documentation

## Round to a defined precision

### Description

This function is an extension with regard to the function `round` from base R as it allows not only digits as precision, but can also round to a user-specified precision. The interval in which the rounding operation is to be carried out also can be specified by the user (default is the unit interval). Alternatively, breaks can be provided.

### Usage

    round_precision(x, breaks = NULL, in_precision = 0.05, in_interval = c(0, 1))

### Arguments

`x` | Vector to be rounded
`breaks` | The breaks used for rounding. Default NULL
`in_precision` | Precition default 0.05
`in_interval` | Interval needs to be larger than the precision value

### Value

A list with two entries:

- `values`: the rounded vector

- `breaks`: the breaks used for rounding

### Examples

     NULL

[Package YAPSA version 1.18.0 Index]