| lt | R Documentation |
Entry point of the lightweight grammar of tables. Returns an object (a
list) that records the data plus a list of table-modifying operations. The
object is rendered to HTML by format() (called automatically by the
print method).
lt(data, ...)
## Default S3 method:
lt(data, auto_format = TRUE, auto_label = TRUE, ...)
data |
A data frame (or anything coercible to one). |
... |
Arguments passed to methods. |
auto_format |
Whether to automatically format numeric columns (rounding,
thousand separators, percentage detection). Set to |
auto_label |
Whether to automatically clean column names for display
by replacing separators ( |
A table object that can be piped into lt_*() functions.
By default all cell values and text (titles, labels, footnotes, ...) are
HTML-escaped, so special characters like <, >, and & render as
literal text. To emit content as raw HTML instead:
For body cells, mark whole columns with lt_html().
For a title, subtitle, column label, spanner, footnote, or note, wrap the
text in I(). For example, lt_header(x, I("<b>Report</b>")) renders the
title as raw HTML, while lt_header(x, "<b>Report</b>") shows the literal
<b> tags.
When a cell value has been formatted (e.g., by auto-formatting or
lt_format()), the original value is stored in the cell's title
attribute and shown as a tooltip on hover. Additionally:
Alt + Click on a table toggles display of all raw values in that table.
Alt + Double-Click on a table toggles raw values globally (all tables
on the page).
Raw values are shown as (value) after the formatted text, highlighted
with a light yellow background.
lt(head(mtcars[, 1:4]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.