print_kable.Rd
This function prints and formats a styled table in either HTML or LaTeX format using kableExtra.
print_kable(
x,
num_col = 1,
rowname_label = NA,
caption = NA,
digits = 2,
fontsize = 16,
big.mark = ",",
na_str = "",
booktabs = TRUE,
escape = TRUE,
format.args = list(decimal.mark = ".", big.mark = ","),
format,
...
)
The matrix or data frame to be formatted as a table.
An integer specifying the number of columns to split the output table into (default: 1).
A character string specifying the column name for the row names; if not provided, the row names will not be printed (default: NA).
A character string specifying the caption for the table (default: ”).
An integer indicating the number of digits to display (default: 2).
Font size for the table (default: 9).
A character string used as the thousands separator for numbers (default: ',').
A string used to replace missing values (default: ”).
Logical indicating whether to use the booktabs formatting (default: TRUE).
Logical indicating whether to escape special characters in the table (default: TRUE).
A list of additional formatting arguments to customize number representation.
A character string specifying the output format: either "latex" or "html".
Additional arguments to be passed to the kbl function.
A styled and formatted table in the specified format (LaTeX or HTML).
dt = mtcars[1:10, 1:3]
print_flextable(dt, num_col = 2, rowname_label = 'car',format='html')
car
mpg
cyl
disp
car
mpg
cyl
disp
Mazda RX4
21.00
6.00
160.00
Valiant
18.10
6.00
225.00
Mazda RX4 Wag
21.00
6.00
160.00
Duster 360
14.30
8.00
360.00
Datsun 710
22.80
4.00
108.00
Merc 240D
24.40
4.00
146.70
Hornet 4 Drive
21.40
6.00
258.00
Merc 230
22.80
4.00
140.80
Hornet Sportabout
18.70
8.00
360.00
Merc 280
19.20
6.00
167.60