View source: R/stata-helpers.R
attach_varlab | R Documentation |
Append variable labels for Stata export
attach_varlab(tbl, labels, overwrite = TRUE)
tbl |
A dataset |
labels |
A set of levels. Either a tibble that has two columns called 'alias' and 'description', OR a vector of the form 'c(alias1 = "description1", alias2 = "description2)' that can be coerced into one. |
mt_stata <- as_tibble(mtcars) |>
attach_varlab(c(cyl = "Number of cylinders", hp = "Gross horsepower"))
# bulk edits by a tibble format
vartab <- tribble(
~ alias, ~description,
"cyl", "Number of cylinders",
"hp", "Gross horsepower"
)
mt_stata <- as_tibble(mtcars) |>
attach_varlab(vartab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.