R: Round any

round_any {reshape} | R Documentation

## Round any

### Description

Round to multiple of any number

### Usage

    round_any(x, accuracy, f=round)

### Arguments

`x` | numeric vector to round
`accuracy` | number to round to
`f` | function to use for round (eg. `floor`)

### Details

Useful when you want to round a number to arbitrary precision

### Author(s)

Hadley Wickham <h.wickham@gmail.com>

### Examples

    round_any(135, 10)
    round_any(135, 100)
    round_any(135, 25)
    round_any(135, 10, floor)
    round_any(135, 100, floor)
    round_any(135, 25, floor)
    round_any(135, 10, ceiling)
    round_any(135, 100, ceiling)
    round_any(135, 25, ceiling)

[Package reshape version 0.8.8 Index]