round_range: Round a range

round_rangeR Documentation

Round a range

Description

This rounds the lower and upper values of a range down and up, respectively, by a user-specified amount. This can be useful, for example, in the creation of plots with suitable axis limits. The function uses round_any.

Usage

round_range(x, digits = "auto")

Arguments

x

A vector of two numbers to be round down and up respectively.

digits

The precision of rounding (e.g. to the nearest 0.1). "auto" is allowed which attempts to define suitable accuracy automatically.

Value

A number.

Author(s)

Edward Lavender

Examples

round_range(c(0.987, 10.982), "auto")


edwardlavender/utils.add documentation built on Dec. 14, 2024, 8:11 a.m.