readstata13 (version 0.10.1)

get.label: Get Stata Label Table for a Label Set

Description

Retrieve the value labels for a specific Stata label set.

Usage

get.label(dat, label.name)

Value

Returns a named vector of code numbers

Arguments

dat

data.frame. Data.frame created by read.dta13.

label.name

character. Name of the Stata label set

Author

Jan Marvin Garbuszus jan.garbuszus@ruhr-uni-bochum.de

Sebastian Jeworutzki sebastian.jeworutzki@ruhr-uni-bochum.de

Details

This function returns the table of factor levels which represent a Stata label set. The name of a label set for a variable can be obtained by get.label.name.

Examples

Run this code
dat <- read.dta13(system.file("extdata/statacar.dta", package="readstata13"))
labname <- get.label.name(dat,"type")
get.label(dat, labname)

Run the code above in your browser using DataLab