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

View source: R/basefunctions.R

roundRR Documentation

Automatic rounding to a reasonable length, based on largest number

Description

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

Usage

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

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

wrappedtools documentation built on Oct. 10, 2024, 5:07 p.m.