Automatic formatting for tables that should "just work" for most use cases. For more fine-grained control, see formatting and padding.
fmt_table(
df,
dec_dig = 1,
prop_dig = 3,
corr_dig = 3,
output = NULL,
fmt_small = TRUE,
keep_zero = FALSE
)
A data frame or tibble to be formatted for printing in output.
The number of decimal places to include for numbers, e.g.,
dec_dig = 1
for 16.5.
The number of decimal places to include for numbers bounded
between [0,1], e.g., prop_dig = 2
for .35.
The number of decimal places to include for numbers bounded
between [-1,1], e.g., corr_dig = 3
for .205.
The output format of the table. One of "latex" or "html". Automatically pulled from document output type if not specified.
Indicator for replacing zero with <
(e.g., .000
becomes
<.001
). Default is TRUE
.
If fmt_small
is TRUE
, whether to preserve true 0s (e.g.,
0.0000001
becomes <.001
, but 0.0000000
stays .000
).
A tibble with the same rows and columns as df
, with numbers
formatted consistently and padded for alignment when printed.
Other formatters:
formatting
,
padding