read.dtas {readstata13}R Documentation

Read frames from Stata dtas files

Description

Stata 18 introduced framesets (file extension '.dtas') that contain zipped 'dta' files. This helper functions imports those files and returns a list of data.frames.

Usage

read.dtas(path, select.frames = NULL, read.dta13.options = NULL)

Arguments

path

path to .dtas file

select.frames

character vector

read.dta13.options

list of parameters used in read.dta13. The list must have the following structure: list(framename = list(param = value))

Value

Returns a named list of data.frames.

Examples


path <- system.file("extdata", "myproject2.dtas", package="readstata13")

# read all frames in myproject2.dtas
read.dtas(path)

# read selected frames
read.dtas(path, select.frames = c("persons", "counties"))

# read only frame counties
read.dtas(path, select.frames = c("counties"))

# read frames with different arguments
read.dtas(path, 
          read.dta13.options = list(counties = list(select.cols = "median_income"),
                                     persons = list(select.cols = "income")))


[Package readstata13 version 0.11.0 Index]