set.label | R Documentation |
Assign value labels from a Stata label set to a variable. If duplicated labels are found, unique labels will be generated according the following scheme: "label_(integer code)". Levels without labels will become <NA>.
set.label(dat, var.name, lang = NA)
dat |
data.frame. Data.frame created by |
var.name |
character. Name of the variable in the data.frame |
lang |
character. Label language. Default language defined by
|
Returns a labeled factor
dat <- read.dta13(system.file("extdata/statacar.dta", package="readstata13"), convert.factors=FALSE) # compare vectors set.label(dat, "type") dat$type # German label set.label(dat, "type", "de")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.