File: stata.get.Rd

package info (click to toggle)
hmisc 4.2-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,332 kB
  • sloc: asm: 27,116; fortran: 606; ansic: 411; xml: 160; makefile: 2
file content (56 lines) | stat: -rw-r--r-- 2,521 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
\name{stata.get}
\alias{stata.get}
\title{Enhanced Importing of STATA Files}
\description{
  Reads a file in Stata version 5-11 binary format format into a
  data frame.
}
\usage{
stata.get(file, lowernames = FALSE, convert.dates = TRUE,
          convert.factors = TRUE, missing.type = FALSE,
          convert.underscore = TRUE, warn.missing.labels = TRUE,
          force.single = TRUE, allow=NULL, charfactor=FALSE, \dots)
}
\arguments{
  \item{file}{input \acronym{SPSS} save file.  May be a file on the \acronym{WWW}, indicated
    by \code{file} starting with \samp{'http://'}.}
  \item{lowernames}{set to \code{TRUE} to convert variable names to
    lower case}
  \item{convert.dates}{see \code{\link[foreign]{read.dta}}}
  \item{convert.factors}{see \code{\link[foreign]{read.dta}}}
  \item{missing.type}{see \code{\link[foreign]{read.dta}}}
  \item{convert.underscore}{see \code{\link[foreign]{read.dta}}}
  \item{warn.missing.labels}{see \code{\link[foreign]{read.dta}}}
  \item{force.single}{set to \code{FALSE} to prevent integer-valued
    variables from being converted from storage mode \code{double} to
    \code{integer}}
  \item{allow}{a vector of characters allowed by \R that should not be
	converted to periods in variable names.  By default, underscores in
	variable names are converted to periods as with \R before version 1.9.}
  \item{charfactor}{set to \code{TRUE} to change character variables to
	factors if they have fewer than n/2 unique values.  Blanks and null
	strings are converted to \code{NA}s.}
  \item{\dots}{arguments passed to \code{\link[foreign]{read.dta}}.}
}
\details{
  \code{stata.get} invokes the \code{\link[foreign]{read.dta}} function in the
  \pkg{foreign} package to read an STATA file, with a default output
  format of \code{\link{data.frame}}.  The \code{\link{label}} function is used to
  attach labels to individual variables instead of to the data frame as
  done by \code{\link[foreign]{read.dta}}.  By default, integer-valued variables are
  converted to a storage mode of integer unless
  \code{force.single=FALSE}.  Date variables are converted to \R
  \code{\link{Date}} variables.  By default, underscores in names are converted to periods.
}
\value{A data frame}
\author{Charles Dupont}
\seealso{\code{\link[foreign]{read.dta}},\code{\link{cleanup.import}},\code{\link{label}},\code{\link{data.frame}},\code{\link{Date}}}
\examples{
\dontrun{
w <- stata.get('/tmp/my.dta')
}
}
\keyword{interface}
\keyword{manip}
\keyword{file}
\concept{STATA data file}