rt_gt {rifttable} | R Documentation |
Turn tibble into gt Table with Custom Formatting
Description
Formatting includes:
Text align to top/left
Smaller row padding
No top border
Bold column labels
If this function is called within a document that is being knit to plain
markdown, such as format: gfm
in a Quarto document or
format: github_document
in an RMarkdown document, then a plain
markdown-formatted table (e.g., without footnotes) is returned via
kable
.
Usage
rt_gt(df, md = 1, indent = 10, remove_border = TRUE)
Arguments
df |
Data frame/tibble |
md |
Optional. If not |
indent |
Optional. Detects cells in the first column of table, e.g.,
from |
remove_border |
Optional. For rows that are indented in the first
column or have an empty first column, remove the upper horizontal border
line? Defaults to |
Value
Formatted gt table
Examples
data(mtcars)
mtcars |>
dplyr::slice(1:5) |>
rt_gt()