# Example data frame
df <- data.frame(
a = c(1.234, 5.678, 9.1011),
b = c(10.1112, 20.1314, 30.1516),
c = c("A", "B", "C")
)
# Apply formatting to all columns
pretty_num_table(df, dp = 2)
# Apply formatting to only selected columns
pretty_num_table(df, include_columns = c("a"), dp = 2)
# Apply formatting to all columns except specified ones
pretty_num_table(df, exclude_columns = c("b"), dp = 2)
# Apply formatting to all columns except specified ones and
# provide alternative value for NAs
pretty_num_table(df, alt_na = "[z]", exclude_columns = c("b"), dp = 2)
Run the code above in your browser using DataLab