Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

readStata

Read a Stata Data Set


Description

readStata reads a Stata data set, stored in a file of type .dta, into an R data frame; it provides a front end to the read.dta13 function in the readstata13 package.

Usage

readStata(file, rownames=FALSE, stringsAsFactors=FALSE,  convert.dates=TRUE)

Arguments

file

path to a Stata .dta file.

rownames

if TRUE (the default is FALSE), the first column in the data set contains row names, which should be unique.

stringsAsFactors

if TRUE (the default is FALSE) then columns containing character data are converted to factors and factors are created from Stata value labels.

convert.dates

if TRUE (the default) then Stata dates are converted to R dates.

Value

a data frame

Author(s)

See Also


RcmdrMisc

R Commander Miscellaneous Functions

v2.7-1
GPL (>= 2)
Authors
John Fox [aut, cre], Robert Muenchen [ctb], Dan Putler [ctb]
Initial release
2020-08-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.