Skip to contents

Deprecated in 0.8.x (it says so once a session and still works), removed in 0.9.0: it is fmt_count_paren(x, bare = TRUE), the same output.

Usage

fmt_count_paren_bare(x, nbsp = " ", na = "")

Arguments

x

Character vector (one table column).

nbsp

Padding character; defaults to the non-breaking space (U+00A0) so RTF / Word keep the alignment. Pass " " for plain text.

na

Text to print for a missing value (NA, and NaN – R counts it as missing). The default "" leaves the cell empty, as before. A non-empty token is right-justified with the other cells, so its right edge lines up with theirs. Inf / -Inf are not missing and print as "Inf" / "-Inf". See the na argument of as_rtftables().

Value

Character vector the same length as x.

Details

Like fmt_count_paren(), but a bare integer count with no parentheses (a lone "0" for a zero count, or a raw event total) is also padded into the same count field, so it lines up under the parenthetical cells instead of drifting out of line. Cells that do not start with an integer (text, decimals, empty cells) are still returned unchanged.

See also

Examples

# deprecated: the same as fmt_count_paren(bare = TRUE)
fmt_count_paren(c("1 (1.2%)", "0", "11 (3.6%)", "108 (35.3%)"), bare = TRUE)
#> [1] "  1 ( 1.2%)" "  0        " " 11 ( 3.6%)" "108 (35.3%)"