assign_label | R Documentation |
A function to assign labels to a data frame
assign_label(data, var = names(data), label = names(data))
data |
A data frame. |
var |
The variables to assign labels. |
label |
The labels to be assigned. |
Case 1:
If the variable's label is already define in the original data frame
but not redefined in assign_label(...)
, its original labels will be kept.
Case 2:
If the variable's label is already define in the original data frame
but re-defined by assign_label(...)
, its labels will be re-defined.
Case 3:
If the variable's label is not define in the original data frame
but it is defined by assign_label(...)
, its labels will added.
Case 4:
If the variable's label is not define in the original data frame,
neither was it defined by assign_label(...)
, its labels will be the
variable name itself.
A data frame with labels updated.
assign_label(r2rtf::r2rtf_adae) |> head()
assign_label(
r2rtf::r2rtf_adae,
var = "USUBJID",
label = "Unique subject identifier"
) |> head()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.