Learn R Programming

APfun (version 0.1.6)

AProunder: AP Rounder

Description

Provides extra options for rounding numbers, such as rounding a value to uneven intervals and setting those intervals to 'snap' or pass through a defined origin value. Can also be used on Extent objects from the raster package.

Usage

AProunder(value, interval, direction = "closest", snap = 0)

Arguments

value

numeric or Extent object. Input value

interval

numeric. The interval to which the input value should be rounded

direction

character. The rounding direction. Can be 'closest', 'up' or 'down' for numeric value arguments or 'closest', 'in' or 'out' for Extent objects.

snap

numeric. An origin value through which the interval with pass through. Default is 0.

Value

Rounded number or Extent object