print_table.Rd
This function prints a styled table in either HTML or LaTeX format, depending on the output document type.
print_table(
df,
num_col = 1,
rowname = NA,
caption = "",
digits = 2,
fontsize = 9,
big.mark = ",",
na_str = "",
...
)
The 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: ”).
Additional arguments to be passed to the formatting functions.
A styled table in HTML or LaTeX format, depending on the document type.
print_table(mtcars[1:10, 1:3], num_col = 2, rowname = 'car')
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