| lt_spanner | R Documentation |
A spanner is a label rendered above a contiguous group of column headers.
lt_spanner(x, label, columns, sep = "[._]")
x |
An |
label |
A character scalar — the spanner text. Alternatively, a
two-sided formula |
columns |
Column names (character or formula). When missing, inferred from column names. |
sep |
Separator pattern for auto-inference (default |
When called with no label or columns, infers spanners from column
names by splitting on the first . or _ separator. Contiguous columns
sharing a prefix are grouped under that prefix, and column labels are
shortened to the suffix.
x with the spanner recorded.
The columns must be contiguous in the body of the table.
tbl = lt(head(iris))
# Explicit spanner
tbl |> lt_spanner(Sepal ~ Sepal.Length + Sepal.Width)
# Auto-infer from column names
tbl |> lt_spanner()
# raw HTML label (wrap in I())
tbl |> lt_spanner(I("<em>Sepal</em>"), ~ Sepal.Length + Sepal.Width)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.