Learn R Programming

bulkreadr (version 1.1.1)

read_stata_data: Read Stata data file

Description

Read Stata data file

Usage

read_stata_data(file, label = FALSE)

Value

A data frame containing the Stata data, with labeled variables converted to factors.

Arguments

file

The path to the Stata data file.

label

Logical indicating whether to use variable labels as column names (default is FALSE).

See Also

read_spss_data() which reads SPSS data file and converts labelled variables into factors.

Examples

Run this code
# Read Stata data file without converting variable labels as column names

file_path <- system.file("extdata", "Wages.dta", package = "bulkreadr")

data <- read_stata_data(file = file_path)

data

# Read Stata data file and convert variable labels as column names

data <- read_stata_data(file = file_path, label = TRUE)

data

Run the code above in your browser using DataLab