rounding: Rounds a numeric vector to arbitrary values (not just decimal...

Description Usage Arguments Value References Examples

Description

Rounds a numeric vector to arbitrary values (not just decimal values as with round). E.g. allows you to round to nearest 0.3 instead of just nearest 1 or 0.1

Usage

1
2
3
  roundnear(vec, roundvec)

  round_sigfig(vec, digits = 2)

Arguments

vec

numeric vector

roundvec

What value to round things to (e.g. nearest 1, 10, 0.3, etc.). Typically a single item to apply to all of vec. If of length greater than 1, usual wrapping rules apply.

digits

Number of significant digits to round to

Value

Rounded numeric vector of length length(vec)

References

http://en.wikipedia.org/wiki/Significant_figures

Examples

1
roundnear( runif(10) , .03 )

taRifx documentation built on April 14, 2020, 6:27 p.m.

Related to rounding in taRifx...