insert_row_at_path | R Documentation |
Insert a row into an existing table directly before or directly after an existing data (i.e., non-content and non-label) row, specified by its path.
insert_row_at_path(tt, path, value, after = FALSE)
## S4 method for signature 'VTableTree,DataRow'
insert_row_at_path(tt, path, value, after = FALSE)
## S4 method for signature 'VTableTree,ANY'
insert_row_at_path(tt, path, value)
tt |
|
path |
character. A vector path for a position within the structure of a
|
value |
The new value |
after |
logical(1). Should |
DataRow()
rrow()
lyt <- basic_table() %>%
split_rows_by("COUNTRY", split_fun = keep_split_levels(c("CHN", "USA"))) %>%
analyze("AGE")
tbl <- build_table(lyt, DM)
tbl2 <- insert_row_at_path(tbl, c("COUNTRY", "CHN", "AGE", "Mean"),
rrow("new row", 555))
tbl2
tbl3 <- insert_row_at_path(tbl2, c("COUNTRY", "CHN", "AGE", "Mean"),
rrow("new row redux", 888),
after = TRUE)
tbl3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.