readStata: Import Stata .dta file using package haven

Description Usage Arguments Value See Also Examples

Description

Import Stata .dta file using package haven

Usage

1
2
readStata(file, encoding = NULL, varNameEncoding = encoding,
  charEncoding = encoding)

Arguments

file

dta file name.

encoding

Encoding for labels, default is UTF-8.

varNameEncoding

Encoding for variable names, default is the same as 'encoding'.

charEncoding

Encoding for character variables, default is the same as 'encoding'.

Value

ez.data.frame class object inherited from data.table

See Also

readSPSS

Other res: as.ez, readSPSS

Examples

1
2
3
4
5
6
library(ezdf)
dat = readStata('CGSS2013(居民问卷) 发布版.dta')
class(dat)
# set encoding properly
dat = readStata('CGSS2013(居民问卷) 发布版.dta', encoding = 'GB2312')
tbl(dat, a66 ~ s5a)

huashan/ezdf documentation built on May 17, 2019, 9:10 p.m.