Learn R Programming

Hmisc (version 5.3-0)

stata.get: Enhanced Importing of STATA Files

Description

Reads a file in Stata version 5-11 binary format format into a data frame.

Usage

stata.get(file, lowernames = FALSE, convert.dates = TRUE,
          convert.factors = TRUE, missing.type = FALSE,
          convert.underscore = TRUE, warn.missing.labels = TRUE,
          force.single = TRUE, allow=NULL, charfactor=FALSE, ...)

Arguments

Value

A data frame

Details

stata.get invokes the read.dta function in the foreign package to read an STATA file, with a default output format of data.frame. The label function is used to attach labels to individual variables instead of to the data frame as done by read.dta. By default, integer-valued variables are converted to a storage mode of integer unless force.single=FALSE. Date variables are converted to R Date variables. By default, underscores in names are converted to periods.

See Also

read.dta,cleanup.import,label,data.frame,Date

Examples

Run this code
if (FALSE) {
w <- stata.get('/tmp/my.dta')
}

Run the code above in your browser using DataLab