Format integer counts with locale-aware thousands separator
Source:R/number_utils.R
format_count.RdFormats integer values with a thousands separator for display in tables. Values below 1000 are returned as plain character strings, since a grouping mark only applies from four digits.
Arguments
- n
Numeric vector of counts.
- marks
List with
big.markanddecimal.markas returned byresolve_number_marks. Resolved from the global option when not supplied, so that callers without a locale of their own still produce output consistent with the rest of the package.- na
Character string substituted for missing values. Contexts differ in what reads correctly: tables conventionally show a dash, plot annotations are better left blank, and the default preserves the missing value for callers doing their own substitution.