round_numbers: Round Numbers

View source: R/utils.R

round_numbersR Documentation

Round Numbers

Description

Rounds the values in its first argument to the specified number of decimal places. This function uses the U.S. Geological Survey rounding method.

Usage

round_numbers(x, digits = 0)

Arguments

x

'numeric' vector. Value to be rounded.

digits

'integer' vector or value. Number of decimal places to use (default 0). Values are recycled to match the vector length of x.

Value

A numeric vector of rounded values.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

Examples

round_numbers(x = rep(pi, 3), digits = c(1, 2, 3))

inldata documentation built on Sept. 12, 2024, 9:34 a.m.