read.dta {misty} | R Documentation |
Read Stata DTA File
Description
This function calls the read_dta
function in the haven package
by Hadley Wickham, Evan Miller and Danny Smith (2023) to read a Stata DTA file.
Usage
read.dta(file, use.value.labels = FALSE, formats = FALSE, label = FALSE, labels = FALSE,
missing = FALSE, widths = FALSE, as.data.frame = TRUE, check = TRUE)
Arguments
file |
a character string indicating the name of the Stata
data file with or without file extension '.dta', e.g.,
|
use.value.labels |
logical: if |
formats |
logical: if |
label |
logical: if |
labels |
logical: if |
missing |
logical: if |
widths |
logical: if |
as.data.frame |
logical: if |
check |
logical: if |
Value
Returns a data frame or tibble.
Note
This function is a modified copy of the read_dta()
function in the
haven package by Hadley Wickham, Evan Miller and Danny Smith (2023).
Author(s)
Hadley Wickham and Evan Miller
References
Wickham H, Miller E, Smith D (2023). haven: Import and Export 'SPSS', 'Stata' and 'SAS' Files. R package version 2.5.3. https://CRAN.R-project.org/package=haven
See Also
read.sav
, write.sav
, read.xlsx
,
write.xlsx
, read.mplus
, write.mplus
Examples
## Not run:
read.dta("Stata_Data.dta")
read.dta("Stata_Data")
# Example 2: Read Stata data, convert variables with value labels into factors
read.dta("Stata_Data.dta", use.value.labels = TRUE)
# Example 3: Read Stata data as tibble
read.dta("Stata_Data.dta", as.data.frame = FALSE)
## End(Not run)