set_variable_labels | R Documentation |
This function leverages metadata available in a metacore object to apply labels to a data frame.
set_variable_labels(data, metacore, dataset_name = NULL)
data |
A dataframe or tibble upon which labels will be applied |
metacore |
metacore object that contains the specifications for the dataset of interest. |
dataset_name |
Optional string to specify the dataset. This is only needed if the metacore object provided hasn't already been subsetted. |
Dataframe with labels applied
mc <- metacore::spec_to_metacore(
metacore::metacore_example("p21_mock.xlsx"),
quiet=TRUE
)
dm <- haven::read_xpt(metatools_example("dm.xpt"))
set_variable_labels(dm, mc, dataset_name = "DM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.