blue: 'blue' - Read a blueprint file and return a merged data...

Description Usage Arguments Value Author(s)

Description

Use a blueprint-file to import a subset of variables from several data files, optionally transform them by specified functions (e.g. to recode values) and recombine them into a new wide data.frame.

Usage

1
2
3
blue(blueprint = options()$blueprint_file, fun = TRUE,
  export_file = NULL, chunks = NULL, logfile = FALSE,
  data.table = TRUE, ...)

Arguments

blueprint

A meta-data file that contains specifications what to do. The file format is taken from the suffix as defined in the import function. See the vignette for details of the structure of a blueprint.

fun

Logical vector wheter the functions from fun should be applied on the specified variables.

export_file

Path to file the data is written after merging. The suffix determines the file type. In addition the data.frame is returned invisible. Note that if you choose to export to stata you have to choose final variable names (column newvar) that comply with the stata convention of stata names. You must use no dots (.) and length of a variable name may not excede a maximum number of 26? characters.

chunks

A numeric vector specifying the chunks that shall be included from the blueprint file. If NULL every chunk will be merged.

logfile

Either a logfile wheter to use an extended logfile. Or path where this extended logfile is written. The extended logfile will contain descriptive statistics and allow for inference to possible problems when transforming data. However the computation of descriptive statistics will take extra time which is why this argument is set to FALSE by default.

data.table

Wheter to use the data.table package for merge process. (Minimal faster)

...

Optionally commands are passed to import. Especially select the sheet of an Excel (.xlsx) files by the argument which.

Value

New merged data.frame according to the blueprint. It is set to the class tibble.

Author(s)

Marc Schwenzer <m.schwenzer@uni-tuebingen.de>


mschwenzer/blueprint documentation built on Nov. 4, 2019, 8:30 p.m.