Learn R Programming

rapport (version 0.31)

rp.round: Round numeric values

Description

Round numeric values with default number of decimals (see: getOption('rp.decimal') and decimal mark (see: getOption('rp.decimal')).

Usage

rp.round(x, short = FALSE, digits = NULL)

Arguments

x
numeric value(s)
short
if getOption('rp.decimal.short' should be used instead of getOption('rp.decimal'. Can be overwritten by digits parameter, see below.
digits
(optional) number of decimals

Value

  • character vector of rounded value(s)

Details

Default parameters are read from options:

  • 'rp.decimal',
  • 'rp.decimal.short',
  • 'rp.decimal.mark'.

Examples

Run this code
{
rp.round(22/7)
rp.round(22/7, short = TRUE)
rp.round(22/7, TRUE)
rp.round(22/7, digits = 10)
rp.round(matrix(runif(9), 3, 3))
}

Run the code above in your browser using DataLab