View source: R/tt_pos_and_access.R
label_at_path | R Documentation |
Accesses or sets the label at a path.
label_at_path(tt, path)
label_at_path(tt, path) <- value
tt |
( |
path |
( |
value |
( |
If path
resolves to a single row, the label for that row is retrieved or set. If, instead, path
resolves to a
subtable, the text for the row-label associated with that path is retrieved or set. In the subtable case, if the
label text is set to a non-NA
value, the labelrow
will be set to visible, even if it was not before. Similarly,
if the label row text for a subtable is set to NA
, the label row will bet set to non-visible, so the row will not
appear at all when the table is printed.
When changing the row labels for content rows, it is important to path all the way to the row. Paths
ending in "@content"
will not exhibit the behavior you want, and are thus an error. See row_paths()
for help
determining the full paths to content rows.
lyt <- basic_table() %>%
split_rows_by("COUNTRY", split_fun = keep_split_levels(c("CHN", "USA"))) %>%
analyze("AGE")
tbl <- build_table(lyt, DM)
label_at_path(tbl, c("COUNTRY", "CHN"))
label_at_path(tbl, c("COUNTRY", "USA")) <- "United States"
tbl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.