Assign Stata Labels to a Variable
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")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.