getNDecimalsRule: Get number of decimals based pre-defined rule(s).

View source: R/decimals.R

getNDecimalsRuleR Documentation

Get number of decimals based pre-defined rule(s).

Description

Note: NA is returned if the element is missing (NA).

Usage

getNDecimalsRule(x, rule = c("1"))

Arguments

x

Numeric vector.

rule

Character vector with rule to use to derive the number of parameters. Currently only: '1' is implemented.

  • '1': standard rule for the number of decimals for individual values for a continuous variable:

    • value < 1 ('very small values'): 3

    • value < 10: 2

    • value in [10, 1000[: 1

    • value >= 1000: 0

Value

Numeric vector of same length than x with the number of decimals.

Author(s)

Laure Cougnaud

Examples

x <- c(0.99, 5.679, 50.45, 1450)
getNDecimalsRule(x = x)

inTextSummaryTable documentation built on June 22, 2024, 9:24 a.m.