Round Numbers
Rounds the values in its first argument to the specified number of decimal places. This function uses the U.S. Geological Survey rounding method.
round_numbers(x, digits = 0)
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
.A numeric vector of rounded values.
round_numbers(x = rep(pi, 3), digits = c(1, 2, 3))
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
Useful links