Learn R Programming

Rmisc (version 1.5.1)

rounder: Round to Increment

Description

Rounds a value to nearest increment

Usage

rounder(x, inc, fun = "round")

Arguments

x

The value to be rounded

inc

The increment to round to

fun

The rounding function. Valid options are 'floor', 'round' and 'ceiling'.

Value

an object of class numeric

Examples

Run this code
# NOT RUN {
rounder(.92, .05)
rounder(.93, .05)
rounder(.93, .05, "floor")
rounder(.93, .05, "ceiling")
# }

Run the code above in your browser using DataLab