File: read.dtas.Rd

package info (click to toggle)
r-cran-readstata13 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 804 kB
  • sloc: cpp: 1,770; ansic: 278; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,254 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tools.R
\name{read.dtas}
\alias{read.dtas}
\title{Read frames from Stata dtas files}
\usage{
read.dtas(path, select.frames = NULL, read.dta13.options = NULL)
}
\arguments{
\item{path}{path to .dtas file}

\item{select.frames}{character vector}

\item{read.dta13.options}{list of parameters used in  \code{\link[readstata13]{read.dta13}}. The list must have the following structure: \code{list(framename = list(param = value))}}
}
\value{
Returns a named list of data.frames.
}
\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.
}
\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")))

}