rnd: Round and format

Description Usage Arguments Details Methods (by class) See Also Examples

Description

Round to a given number of significant digits to show variability in a vector of numbers.

Usage

1
2
3
4
rnd(x, digits, ...)

## Default S3 method:
rnd(x, digits = 3, ..., verbose = 0)

Arguments

x

an object to be rounded and formatted

digits

significant digits for variation in x

...

passed on to format function

Details

Instead of rounding to a given number of significant digits, or rounding to a given significance, 'rnd' rounds so that the variability in a set of number is exhibited to a given number of digits. For example, 100.1233, 100.2345, 100.3456, rounded to 3 significant digits would be 100., 100., 100., but rounded to 3 significant digits for variability is 100.123, 100.234, 100.345.

Methods (by class)

See Also

pfmt, rpfmt

Examples

1
2
3
4
5
6
rnd(c(0.00001111111,0.000022222,0.000015), scientific = F)
rnd(c(0.00001111111,0.000022222,0.000015)+100, scientific = F)
round(c(0.00001111111,0.000022222,0.000015))
round(c(0.00001111111,0.000022222,0.000015)+100)
rnd(123)
rnd(123.45678901)

gmonette/yscs documentation built on May 17, 2019, 7:28 a.m.