varlabel | R Documentation |
Retrieve or set variable labels for a dataset.
varlabel(dat, var.name = NULL, lang = NA) varlabel(dat) <- value
dat |
data.frame. Data.frame created by |
var.name |
character vector. Variable names. If NULL, get label for all variables. |
lang |
character. Label language. Default language defined by
|
value |
character vector. Character vector of size ncol(data) with variable names. |
Returns an named vector of variable labels
Jan Marvin Garbuszus jan.garbuszus@ruhr-uni-bochum.de
Sebastian Jeworutzki sebastian.jeworutzki@ruhr-uni-bochum.de
dat <- read.dta13(system.file("extdata/statacar.dta", package="readstata13"), convert.factors=FALSE) # display variable labels varlabel(dat) # display german variable labels varlabel(dat, lang="de") # display german variable label for brand varlabel(dat, var.name = "brand", lang="de") # define new variable labels varlabel(dat) <- letters[1:ncol(dat)] # display new variable labels varlabel(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.