read.dta | R Documentation |
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.
read.dta(file, use.value.labels = FALSE, formats = FALSE, label = FALSE, labels = FALSE,
missing = FALSE, widths = FALSE, as.data.frame = TRUE, check = TRUE)
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 |
Returns a data frame or tibble.
This function is a modified copy of the read_dta()
function in the
haven package by Hadley Wickham, Evan Miller and Danny Smith (2023).
Hadley Wickham and Evan Miller
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
read.sav
, write.sav
, read.xlsx
,
write.xlsx
, read.mplus
, write.mplus
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.