roundR: Automatic rounding to a reasonable length, based on largest...

Description Usage Arguments Value Examples

View source: R/basefunctions.R

Description

roundR takes a vector or matrix of numbers and returns rounded values with selected precision and various formatting options.

Usage

1
2
3
4
5
6
7
8
9
roundR(
  roundin,
  level = 2,
  smooth = FALSE,
  textout = TRUE,
  drop0 = FALSE,
  .german = FALSE,
  .bigmark = FALSE
)

Arguments

roundin

A vector or matrix of numbers.

level

A number specifying number of relevant digits to keep.

smooth

A logical specifying if you want rounding before the dot (e.g. 12345 to 12300).

textout

A logical if output is converted to text.

drop0

A logical if trailing zeros should be dropped.

.german

A logical if german numbers should be reported.

.bigmark

A logical if big.mark is to be shown, mark itself depends on parameter .german.

Value

vector of type character (default) or numeric, depending on parameter textout.

Examples

1
2
3
roundR(1.23456, level = 3)
roundR(1.23456, level = 3, .german = TRUE)
roundR(1234.56, level = 2, smooth = TRUE)

wrappedtools documentation built on Sept. 6, 2021, 5:08 p.m.