Learn R Programming

RTLknitr (version 1.0.0)

tab_header_lbl: Create a Labeled Header for gt Tables

Description

This function enhances the gt package's tab_header function by allowing the inclusion of a label for referencing the table in LaTeX documents.

Usage

tab_header_lbl(data, title, subtitle = NULL, label = NULL)

Value

LaTeX-formatted table header.

Arguments

data

A gt table object.

title

Title of the table.

subtitle

Subtitle of the table.

label

Label for referencing the table in LaTeX.

Details

Be sure to use this function at the end of gt format functions. This function returns a LaTeX-formatted table header.

Examples

Run this code
require(gt)
head(iris) |> gt() |> tab_header_lbl(title = "iris",label = "tab:iris") |> cat()

Run the code above in your browser using DataLab