xunits: Determine the appropriate unit for a value.

View source: R/NMFSReports.R

xunitsR Documentation

Determine the appropriate unit for a value.

Description

Determine the appropriate unit for a value (e.g., 1000000 = '1 Million'.

Usage

xunits(value, val_under_x_words = 10, words = TRUE)

Arguments

value

A numeric value.

val_under_x_words

a numeric that defines what values should be words as opposed to characters in a text. For example, many styles prefer that all values from 0 to 10 are spelled out in words, so you would set this parameter to 10 (which is the default). Set this parameter to NULL for nothing to to be spelled out.

words

T/F. Default = TRUE. If TRUE, "1000000" would become "1 Million" and if FALSE would become "1,000,000".

Examples

xunits(value = NA)
xunits(value = c(0, 1))
xunits(value = c(0, 1), val_under_x_words = 0)
xunits(value = 12)
xunits(value = c(12345, 123456, 1234567))
xunits(value = 123456789)
xunits(value = 123456789, words = FALSE)

EmilyMarkowitz-NOAA/NMFSReports documentation built on March 26, 2023, 1:08 a.m.