| lt_group | R Documentation |
Partition rows into labeled groups. Pass column names to group by those
columns' values (the columns are removed from the body and rendered as
rowspan cells on the left). Use sep = TRUE to render groups as
full-width separator rows instead of rowspan.
lt_group(x, ..., sep = "auto", sort = TRUE)
x |
An |
... |
A column name or formula (e.g., |
sep |
If |
sort |
If |
x with the row groups recorded.
# Group by a column (rowspan, default)
d = data.frame(arm = c("Placebo", "Placebo", "Treatment", "Treatment"),
stat = c("n", "Mean", "n", "Mean"), value = c(30, 4.2, 31, 6.8))
lt(d) |> lt_group(~ arm)
# Separator-row style
lt(d) |> lt_group(~ arm, sep = TRUE)
# Manual groups (always separator rows)
lt(head(mtcars)) |>
lt_group("First three" = 1:3, "Last three" = 4:6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.