Learn R Programming

sdcMicro (version 5.6.1)

readMicrodata: readMicrodata

Description

reads data from various formats into R. Used in sdcApp.

Usage

readMicrodata(
  path,
  type,
  convertCharToFac = TRUE,
  drop_all_missings = TRUE,
  ...
)

Value

a data.frame or an object of class 'simple.error'. If a stata file was read in, the resulting data.frame

has an additional attribute lab in which variable and value labels are stored.

Arguments

path

a file path

type

which format does the file have. currently allowed values are

  • sas

  • spss

  • stata

  • R

  • rdf

  • csv

convertCharToFac

(logical) if TRUE, all character vectors are automatically converted to factors

drop_all_missings

(logical) if TRUE, all variables that contain NA-values only will be dropped

...

additional parameters. Currently used only if type='csv' to pass arguments to read.table().

Author

Bernhard Meindl