getNDecimalsRule {inTextSummaryTable}R 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)

[Package inTextSummaryTable version 3.3.2 Index]