fragment_count: Create a count fragment based on an integer value and...

Description Usage Arguments Examples

View source: R/fragment_count_refac.R

Description

Create a count fragment based on an integer value and singular/plural units

Usage

1
2
fragment_count(x, units, fallback = 0, spellout = FALSE,
  comma = !spellout, thousands_mark = ",", decimal_mark = ".")

Arguments

x

An integer value.

units

A vector of length 2 indicating the singular and plural of x's units (e.g., c("country","countries")).

fallback

The character string to return in case of error

spellout

Should the integer be expressed as a word (e.g., 17 becomes "seventeen")

comma

Should the integer include a thousands in the

thousands_mark

The character used to separate orders of a thousand

decimal_mark

The character used as the decimal

Examples

1
fragment_count(as.integer(c(1, 2, 3, NA)), units = c('letter', 'letters'), fallback = "an unknown number of")

polymathematic/Longform documentation built on Jan. 16, 2020, 10:12 p.m.