View source: R/bcat_extract_metadata.R
| bcat_extract_metadata | R Documentation |
This utility function is useful for extracting column values that will be used for inline text by saving metadata column values in a nested (named) list.
bcat_extract_metadata(df, id_col)
df |
input data |
id_col |
ID column used identify observations |
A named list. Each top-level element corresponds to a metadata column
in df, and each nested element is named by id_col values and
stores the matching column value.
Saannidhya Rawat
Other utilities:
bcat_import_data(),
bcat_new_quarto(),
bcat_setup_rmd(),
bcat_source_rmd()
library(Rbearcat)
library(tibble)
lob_df <- tibble(lob = c("drl", "mla", "rac"),
balance = bcat_fmt_dollar(c(11, 26, 7)),
nco = bcat_fmt_dollar(c(80, 45, 800)))
# extract metadata from each column and save to list
lob_meta <- bcat_extract_metadata(lob_df, lob)
# extract individual values from list
lob_meta$balance$mla
lob_meta$nco$rac
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.